Re: /usr/local/etc/rc.d/*.sh not working?

From: Erik Trulsson (ertr1013_at_student.uu.se)
Date: 06/15/05

  • Next message: Erik Trulsson: "Re: /usr/local/etc/rc.d/*.sh not working?"
    Date: Wed, 15 Jun 2005 07:06:21 +0200
    To: Daniel O'Connor <doconnor@gsoft.com.au>
    
    

    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@student.uu.se
    _______________________________________________
    freebsd-stable@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-stable
    To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org"
    

  • Next message: Erik Trulsson: "Re: /usr/local/etc/rc.d/*.sh not working?"

    Relevant Pages