Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Jul 2004 09:44:39 +0300
From:      Mike Makonnen <mtm@identd.net>
To:        Andrey Chernov <ache@nagual.pp.ru>, Joe Marcus Clarke <marcus@FreeBSD.org>, ports@FreeBSD.org
Subject:   Re: [Fwd: Recent changes to rc.d on -CURRENT]
Message-ID:  <20040727064438.GA1403@rogue.acs-et.com>
In-Reply-To: <20040726220821.GA80533@nagual.pp.ru>
References:  <1090870254.6881.31.camel@shumai.marcuscom.com> <20040726193539.GA76196@nagual.pp.ru> <1090871921.6881.49.camel@shumai.marcuscom.com> <20040726214357.GA80423@nagual.pp.ru> <1090878694.6881.78.camel@shumai.marcuscom.com> <20040726220821.GA80533@nagual.pp.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Jul 27, 2004 at 02:08:21AM +0400, Andrey Chernov wrote:
> On Mon, Jul 26, 2004 at 05:51:35PM -0400, Joe Marcus Clarke wrote:
> > > Yes, they are unset, but I still see
> > > *.sh)                           # run in current shell
> > > 	set $_arg ; . $_file
> > > in run_rc_script().
> > > It means 
> > > eval /usr/bin/limits -e -U www 
> > > will be invoked in the current shell once (when apache.sh will be 
> > > processed) and affect all following scripts. May I overlook something?
> > 
> > Sorry, I misunderstood.  Yes, those limits would be inherited until
> > another script adjusted them.  Why not override the start_cmd, and run:
> > 
> > /usr/bin/limits -e -U www ${command}
> > 
> > That said, portmgr is working on a better solution for problems like
> > this.
> 
> Of course, it will be workaround, but IMHO current approach is mistake and 
> effectively cuts down usefulness of start_precmd etc. things. Moreover, 
> some single buggy script installed can ruin all following scripts. 
> Previous separate subshell way does right thing, i.e. buggy script can 
> ruin only its own subshell. Better to back this change out.

Ports rc.d scripts have always been broken. It's just that it wasn't
noticeable because rc.d/localpkg was also broken.

The rc.d mechanism with respect to sourcing scripts works like this:
	o scripts ending in '.sh' are sourced in the current subshell
	o all other scripts are sourced in a subshell.

This means that unless a port really requires that it be sourced in
the parent shell, all startup scripts should be installed without a
'.sh' extension. This will be even more important since there will
probably be a mechanism to include ports scripts in the rcorder(8)
process at boot in the near future.

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?20040727064438.GA1403>