Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 May 2004 19:02:29 -0600
From:      "Chad Leigh -- Shire.Net LLC" <chad@shire.net>
To:        freebsd-questions@freebsd.org Questions <freebsd-questions@freebsd.org>
Subject:   Re: FreeBSD 5 rc.d scripts and /usr/local/etc/rc.d
Message-ID:  <351B402A-A479-11D8-A0B4-003065A70D30@shire.net>
In-Reply-To: <20040513083639.512f9908@bofh.spyderweb.com.au>
References:  <67797B99-A468-11D8-A0B4-003065A70D30@shire.net> <20040513083639.512f9908@bofh.spyderweb.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help

On May 12, 2004, at 5:06 PM, Tim Aslat wrote:

> In the immortal words of "Chad Leigh -- Shire.Net LLC"
> <chad@shire.net>...
>> "The best way to handle rc.local, however, is to separate it
>>       out into rc.d/ style scripts and place them under
>> /usr/local/etc/rc.d/."
>
> That's right
>
>> So I created an rc.d style script for my own service and stuck it in
>> /usr/local/etc/rc.d/.  It does not have a .sh on the end as it should
>> run in a subshell as detailed in the rc man page.  I also added
>
> There's your problem, all scripts in rc.d must have a .sh extension or
> they will be ignored (unless included from another script/program)
>
> rename to myscript.sh and it will work

However, the rc man page says:

"    4.   Call each script in turn using run_rc_script() (from 
rc.subr(8)),
           which sets $1 to ``start'', and sources the script in a 
subshell.
           If the script has a .sh suffix then it is sourced directly 
into the
           current shell.
"

So what you are saying is that rc on startup does NOT do the same stuff 
on /usr/local/etc/rc.d/ as it does on /etc/rc.d?  It does not get a 
list, check them for nostart, order them and then run each one using 
run_rc_script()?

If that is so, why does the man page say to make rc.d style scripts and 
place them under /usr/local/etc/rc.d  if it is not going to do rc style 
processing on them?

Trying to wrap my head around this

Thanks
Chad



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?351B402A-A479-11D8-A0B4-003065A70D30>