summaryrefslogtreecommitdiffstats
path: root/sbin/umount
diff options
context:
space:
mode:
authormdodd <mdodd@FreeBSD.org>2003-04-07 12:56:01 +0000
committermdodd <mdodd@FreeBSD.org>2003-04-07 12:56:01 +0000
commit3b255b5f8c5935f760a0f92a2444e71b568f1eb8 (patch)
tree39443648f1c42fa412f55e21465bddccde82880e /sbin/umount
parent7c43f96140c9e0208ae1f650102cab1a120e7295 (diff)
downloadFreeBSD-src-3b255b5f8c5935f760a0f92a2444e71b568f1eb8.zip
FreeBSD-src-3b255b5f8c5935f760a0f92a2444e71b568f1eb8.tar.gz
Implement the '-F' option for mount & umount which allows the user to
specify an alternate fstab file.
Diffstat (limited to 'sbin/umount')
-rw-r--r--sbin/umount/umount.812
-rw-r--r--sbin/umount/umount.c9
2 files changed, 18 insertions, 3 deletions
diff --git a/sbin/umount/umount.8 b/sbin/umount/umount.8
index 8d75508..bdaa34b 100644
--- a/sbin/umount/umount.8
+++ b/sbin/umount/umount.8
@@ -44,6 +44,7 @@
.Ar special \&| node
.Nm
.Fl a | A
+.Op Fl F Ar fstab
.Op Fl fv
.Op Fl h Ar host
.Op Fl t Ar type
@@ -73,6 +74,10 @@ are unmounted.
.It Fl A
All the currently mounted file systems except
the root are unmounted.
+.It Fl F Ar fstab
+Specify the
+.Pa fstab
+file to use.
.It Fl f
The file system is forcibly unmounted.
Active special devices continue to work,
@@ -115,6 +120,13 @@ file.
Verbose, additional information is printed out as each file system
is unmounted.
.El
+.Sh ENVIRONMENT
+.Bl -tag -width PATH_FSTAB
+.It Pa PATH_FSTAB
+If the environment variable
+.Pa PATH_FSTAB
+is set all operations are performed against the specified file.
+.El
.Sh FILES
.Bl -tag -width /etc/fstab -compact
.It Pa /etc/fstab
diff --git a/sbin/umount/umount.c b/sbin/umount/umount.c
index 3969860..8ffdbce 100644
--- a/sbin/umount/umount.c
+++ b/sbin/umount/umount.c
@@ -100,7 +100,7 @@ main(int argc, char *argv[])
sync();
all = errs = 0;
- while ((ch = getopt(argc, argv, "Aafh:t:v")) != -1)
+ while ((ch = getopt(argc, argv, "AaF:fh:t:v")) != -1)
switch (ch) {
case 'A':
all = 2;
@@ -108,6 +108,9 @@ main(int argc, char *argv[])
case 'a':
all = 1;
break;
+ case 'F':
+ setfstab(optarg);
+ break;
case 'f':
fflag = MNT_FORCE;
break;
@@ -184,7 +187,7 @@ main(int argc, char *argv[])
break;
case 1:
if (setfsent() == 0)
- err(1, "%s", _PATH_FSTAB);
+ err(1, "%s", getfstab());
errs = umountall(typelist);
break;
case 0:
@@ -751,6 +754,6 @@ usage()
(void)fprintf(stderr, "%s\n%s\n",
"usage: umount [-fv] special | node",
- " umount -a | -A [-fv] [-h host] [-t type]");
+ " umount -a | -A [ -F fstab] [-fv] [-h host] [-t type]");
exit(1);
}
OpenPOWER on IntegriCloud