rc.subr exits prematurely

Peter Pentchev roam at ringlet.net
Wed Jul 28 05:02:30 PDT 2004


On Tue, Jul 27, 2004 at 07:34:26PM +0300, Mike Makonnen wrote:
> 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.

Okay, so rc scripts that expect to be called in a subshell should be
named without the '.sh' suffix.  What does this mean for 4.x though,
where only scripts *with* the '.sh' suffix are ever executed?  Should
the ports provide differently-named scripts for 4.x and 5.x (or rather,
for OSVERSION's before and after the rc.subr overhaul)?

G'luck,
Peter

-- 
Peter Pentchev	roam at ringlet.net    roam at cnsys.bg    roam at FreeBSD.org
PGP key:	http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint	FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
When you are not looking at it, this sentence is in Spanish.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-rc/attachments/20040728/6cc6adaa/attachment.bin


More information about the freebsd-rc mailing list