FreeBSD 5 rc.d scripts and /usr/local/etc/rc.d
Chad Leigh -- Shire.Net LLC
chad at shire.net
Wed May 12 18:02:34 PDT 2004
On May 12, 2004, at 5:06 PM, Tim Aslat wrote:
> In the immortal words of "Chad Leigh -- Shire.Net LLC"
> <chad at 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
More information about the freebsd-questions
mailing list