From owner-freebsd-hackers Mon Nov 3 18:12:58 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id SAA25207 for hackers-outgoing; Mon, 3 Nov 1997 18:12:58 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from smtp04.primenet.com (smtp04.primenet.com [206.165.5.85]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id SAA25200 for ; Mon, 3 Nov 1997 18:12:56 -0800 (PST) (envelope-from tlambert@usr09.primenet.com) Received: (from daemon@localhost) by smtp04.primenet.com (8.8.7/8.8.7) id TAA23920; Mon, 3 Nov 1997 19:12:46 -0700 (MST) Received: from usr09.primenet.com(206.165.6.209) via SMTP by smtp04.primenet.com, id smtpd023903; Mon Nov 3 19:12:38 1997 Received: (from tlambert@localhost) by usr09.primenet.com (8.8.5/8.8.5) id TAA14153; Mon, 3 Nov 1997 19:12:36 -0700 (MST) From: Terry Lambert Message-Id: <199711040212.TAA14153@usr09.primenet.com> Subject: Re: portal pid not correct... To: gurney_j@resnet.uoregon.edu Date: Tue, 4 Nov 1997 02:12:36 +0000 (GMT) Cc: freebsd-hackers@FreeBSD.ORG In-Reply-To: <19971102014238.14394@hydrogen.nike.efn.org> from "John-Mark Gurney" at Nov 2, 97 01:42:38 am X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > 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. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.