Commit 5fd2acfa authored by Mike Hibler's avatar Mike Hibler

Add a -N option to mount to not HUP mountd after a mount.

We use this on the Mothership for geni-lib jail setup.
parent b9ced3d1
#
# Incorporate a Utah option to not HUP mountd after a successful mount.
#
# cd /usr/src/sbin
# sudo patch -p0 < patchfile
#
diff -Nur mount.orig/mount.c mount/mount.c
--- mount.orig/mount.c 2019-08-09 15:18:36.639586000 -0600
+++ mount/mount.c 2019-08-09 15:16:54.895152000 -0600
@@ -246,15 +246,15 @@
struct fstab *fs;
struct statfs *mntbuf;
int all, ch, i, init_flags, late, failok, mntsize, rval, have_fstab, ro;
- int onlylate;
+ int onlylate, nohupmountd;
char *cp, *ep, *options;
- all = init_flags = late = onlylate = 0;
+ all = init_flags = late = onlylate = nohupmountd = 0;
ro = 0;
options = NULL;
vfslist = NULL;
vfstype = "ufs";
- while ((ch = getopt(argc, argv, "adF:fLlno:prt:uvw")) != -1)
+ while ((ch = getopt(argc, argv, "adF:fLlNno:prt:uvw")) != -1)
switch (ch) {
case 'a':
all = 1;
@@ -275,6 +275,9 @@
case 'l':
late = 1;
break;
+ case 'N':
+ nohupmountd = 1;
+ break;
case 'n':
/* For compatibility with the Linux version of mount. */
break;
@@ -465,7 +468,7 @@
* If the mount was successfully, and done by root, tell mountd the
* good news.
*/
- if (rval == 0 && getuid() == 0)
+ if (rval == 0 && getuid() == 0 && !nohupmountd)
restart_mountd();
exit(rval);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment