From owner-freebsd-hackers Tue Nov 4 01:16:40 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id BAA27130 for hackers-outgoing; Tue, 4 Nov 1997 01:16:40 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from hydrogen.nike.efn.org (resnet.uoregon.edu [128.223.170.28]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id BAA27125 for ; Tue, 4 Nov 1997 01:16:36 -0800 (PST) (envelope-from gurney_j@efn.org) Received: (from jmg@localhost) by hydrogen.nike.efn.org (8.8.7/8.8.7) id BAA10031; Tue, 4 Nov 1997 01:16:31 -0800 (PST) Message-ID: <19971104011630.17437@hydrogen.nike.efn.org> Date: Tue, 4 Nov 1997 01:16:30 -0800 From: John-Mark Gurney To: Terry Lambert Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: portal pid not correct... References: <19971102014238.14394@hydrogen.nike.efn.org> <199711040212.TAA14153@usr09.primenet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.69 In-Reply-To: <199711040212.TAA14153@usr09.primenet.com>; from Terry Lambert on Tue, Nov 04, 1997 at 02:12:36AM +0000 Reply-To: John-Mark Gurney Organization: Cu Networking X-Operating-System: FreeBSD 2.2.1-RELEASE i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk 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