2007-08-07 00:00:12

by NeilBrown

[permalink] [raw]
Subject: Re: [PATCH 10/10] mount.nfs: Fix background mounts

On Tuesday August 7, [email protected] wrote:
> On Fri, Aug 03, 2007 at 01:24:15PM -0400, Chuck Lever wrote:
> > The new mount.nfs helper does not support background mounts. Add support
> > for background mounts.
>
> I've now pushed the current git (which includes these patches) into Debian,
> which will hopefully give us some experience with "bg" again. It seems to
> have fixed some bugs of the old bg implementation, but this one still
> remains:
>
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=144185
>
> Any chance mount.nfs could simply ignore HUPs?
>
> /* Steinar */
> --
> Homepage: http://www.sesse.net/

Something like this? Anyone want to test it?

NeilBrown


diff --git a/utils/mount/mount.c b/utils/mount/mount.c
index a232519..5769cd2 100644
--- a/utils/mount/mount.c
+++ b/utils/mount/mount.c
@@ -530,9 +530,7 @@ int main(int argc, char *argv[])
* Parent exits immediately with success. Make
* sure not to free "mount_point"
*/
- if (fork() > 0)
- exit(0);
-
+ daemon(0,0);
mnt_err = try_mount(spec, mount_point, flags, fs_type,
&extra_opts, mount_opts, fake,
nomtab, BACKGROUND);

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs


2007-08-09 19:16:14

by Steinar H. Gunderson

[permalink] [raw]
Subject: Re: [PATCH 10/10] mount.nfs: Fix background mounts

On Mon, Aug 06, 2007 at 08:31:29PM -0400, Chuck Lever wrote:
> Steinar, it's not clear to me from the Debian bug report whether this is
> really a mount bug or an init scripts bug.

To me neither, unfortunately. The bug is something like five years old :-)
(If the code hasn't changed, I doubt it has magically fixed itself, though.)

> I assume this is something that did not work correctly for the legacy
> util-linux mount command either?

It's from way before mount was moved to nfs-utils.

/* Steinar */
--
Homepage: http://www.sesse.net/

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs