Usr/local/etc/rc.d
Ninereasons (Talk | contribs) (→rc.subr: - manually starting <service> ( <service>_enable="NO")) |
|||
(6 intermediate revisions by one user not shown) | |||
Line 22: | Line 22: | ||
Note that scripts in /usr/local/etc/rc.d cannot and will not execute, at boot time or otherwise, if you do not set the permissions to allow their execution. In most cases, you will want to [[chmod]] 755 any rc.d scripts, though you may also consider 700 on root-owned rc.d scripts to make sure that unprivileged users don't mess with attempting to start or stop sensitive services. | Note that scripts in /usr/local/etc/rc.d cannot and will not execute, at boot time or otherwise, if you do not set the permissions to allow their execution. In most cases, you will want to [[chmod]] 755 any rc.d scripts, though you may also consider 700 on root-owned rc.d scripts to make sure that unprivileged users don't mess with attempting to start or stop sensitive services. | ||
− | + | The most recent versions of FreeBSD make [[rc.conf]] more integral to the startup of local services. For information about the way that [[daemon]]s are started in the newest versions of FreeBSD, see [[rc.subr]]. | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
[[Category:Important Config Files]] | [[Category:Important Config Files]] |
Latest revision as of 13:09, 5 May 2007
/usr/local/etc/rc.d isn't actually a config file, it's a directory. Any executable shell script in this directory will be executed (using the Bourne shell) with the argument "start" when the system boots, and again with the argument "stop" when the system is shut down.
You may find this generic rc.d script (shown as I use it to start bind9) handy for general purpose use:
#!/bin/sh case "$1" in start) /usr/sbin/named -c /etc/namedb/named.conf & echo "bind9" exit 0 ;; stop) exec killall named ;; *) echo "Usage: `basename $0` {start|stop}" >&2 exit 64 ;; esac
Note that scripts in /usr/local/etc/rc.d cannot and will not execute, at boot time or otherwise, if you do not set the permissions to allow their execution. In most cases, you will want to chmod 755 any rc.d scripts, though you may also consider 700 on root-owned rc.d scripts to make sure that unprivileged users don't mess with attempting to start or stop sensitive services.
The most recent versions of FreeBSD make rc.conf more integral to the startup of local services. For information about the way that daemons are started in the newest versions of FreeBSD, see rc.subr.