rc.subr exits prematurely

Mike Makonnen mtm at identd.net
Tue Jul 27 09:34:22 PDT 2004

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.

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

More information about the freebsd-rc mailing list