Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Jul 2004 19:34:26 +0300
From:      Mike Makonnen <mtm@identd.net>
To:        Peter Pentchev <roam@ringlet.net>
Cc:        freebsd-rc@freebsd.org
Subject:   Re: rc.subr exits prematurely
Message-ID:  <20040727163426.GB81394@rogue.acs-et.com>
In-Reply-To: <20040727123712.GA1196@straylight.m.ringlet.net>
References:  <20040727123712.GA1196@straylight.m.ringlet.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Jul 27, 2004 at 03:37:12PM +0300, Peter Pentchev wrote:
> Hi,
> 
> With the recent changes to rc.subr so that it executes port startup scripts
> in the same shell instead of in a subshell, another problem has come up.
> For the scripts which record a PID file, a check is made on startup and on
> shutdown for the PID file's existence, and if it fails, rc.subr exits, which
> prevents the rest of the scripts from being executed.  Attached is a quick
> patch which works around this problem, but may introduce others - I'm not
> quite sure I understand all of rc.subr's internal workings :)
> 

The brokeness is in the port startup script. One of the things ports
scripts need to do is install the script without a .sh suffix, so that
it does not get executed in the parent shell, and instead in a subshell.

The only things that should get executed in the same shell are scripts
like rc.d/rcconf.sh, which is there to load the contents of rc.conf.

Cheers.
--
Mike Makonnen  | GPG-KEY: http://www.identd.net/~mtm/mtm.asc
mtm@identd.net | Fingerprint: AC7B 5672 2D11 F4D0 EBF8  5279 5359 2B82 7CD4 1F55
mtm@FreeBSD.Org| FreeBSD - Unleash the Daemon !



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040727163426.GB81394>