Date: Tue, 4 Nov 1997 01:16:30 -0800 From: John-Mark Gurney <gurney_j@efn.org> To: Terry Lambert <tlambert@primenet.com> Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: portal pid not correct... Message-ID: <19971104011630.17437@hydrogen.nike.efn.org> In-Reply-To: <199711040212.TAA14153@usr09.primenet.com>; from Terry Lambert on Tue, Nov 04, 1997 at 02:12:36AM %2B0000 References: <19971102014238.14394@hydrogen.nike.efn.org> <199711040212.TAA14153@usr09.primenet.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Terry Lambert scribbled this message on Nov 4: > > I took a look at the code.. and basicly it doesn't become a daemon before > > tring to mount the fs... and this is understandable else you can't return > > a failed mount... > > > > now as I see this, there are a couple ways to fix this... > > a) just become a daemon and then mount, this isn't very attrative > > as the error doesn't get reported > > b) do something were it will fork off the child, child will > > immediately SIGSTOP itself, then parent will mount, and then > > parent will SIGCONT the process for normal execution, or kill > > it off if the mount failed. > > c) insert your idea hear > > > > comments? ideas? > > Use vfork for the side effect before child exit/exec. Man vfork for > details. but I thought that the child ran until it either exit'd of exec'd? how would the parent mount it while the child waited? from man vfork: The parent process is suspended while the child is using its resources. also, the pipe idea is a good one, but why would it be better than the my signal routine? it sounds like more code as you have to do file descriptor tracking... the signal way, you would only add about 5 lines of code the the program (and then a few more as we can't use daemon anymore :( )... well.. I have my implementation working right now... diff is a bit large as I had to indent a block of code... my patch: http://resnet.uoregon.edu:6971/~jmg/FreeBSD/mount_portal.patch (it also includes a missing header for the declaration of umask) -- John-Mark Gurney Modem/FAX: +1 541 683 6954 Cu Networking Live in Peace, destroy Micro$oft, support free software, run FreeBSD
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19971104011630.17437>