[Fwd: Recent changes to rc.d on -CURRENT]

Mike Makonnen mtm at identd.net
Mon Jul 26 23:43:39 PDT 2004

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.

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-ports mailing list