/usr/local/etc/rc.d/*.sh not working?
Erik Trulsson
ertr1013 at student.uu.se
Wed Jun 15 05:06:24 GMT 2005
On Wed, Jun 15, 2005 at 10:46:22AM +0930, Daniel O'Connor wrote:
> On Wed, 15 Jun 2005 01:18, Vivek Khera wrote:
> > On Jun 14, 2005, at 11:19 AM, Michael W. Lucas wrote:
> > > For example, I have a server with about 400 separate MRTG daemons on
> > > it. (Yes, they must be separate, for administrative rather than
> > > technical reasons.) Each daemon has a custom script. These aren't
> > > ports, and they have no rcNG infrastructure.
> >
> > that many, eh...
> >
> > perhaps you're running into a shell command line limit somewhere
> > which does something like
> >
> > foreach i (/usr/local/etc/rc.d/*.sh)
> >
> > and having that glob expansion blowing up in the shell.
>
> find /usr/local/etc/rc.d -name \*.sh -exec {} start \;
For only 400 scripts there should not be any problem with glob
expansion (unless all the scripts have extremely long filenames.)
For 4000 scripts I would not be surprised if there were problems with
glob expansion, but that should not happen for a mere 400 scripts.
>
> Although old style scripts SHOULD work if it ends in .sh and is executable.
>
> According to my reading of rc.subr - if they end in .sh they will be sourced
> in the current shell, otherwise they will be sourced in a subshell.. Dunno if
> that is affecting things (see run_rc_script)
By my reading of rc.subr, that is only true for scripts in /etc/rc.d/
The scripts in /usr/local/etc/rc.d/ are started by /etc/rc.d/localpkg and
are always run in a subshell.
Old style scripts in /usr/local/etc/rc.d/ should work just the same as
before.
--
<Insert your favourite quote here.>
Erik Trulsson
ertr1013 at student.uu.se
More information about the freebsd-stable
mailing list