Where to put my own startup script (/etc/rc.local ?)

Kevin Oberman oberman at es.net
Tue May 25 14:08:32 PDT 2004


You can put them in /usr/local/etc/rc.d or /etc/rc.d. The former is the
more acceptable and should be used if the startup can be run at the end
of the startup. The latter is not ideal, but it allows the script to be
run (see rcorder(8)) at most any point in the startup when adequate
resources are available. I would urge you to go with
/usr/local/etc/rc.d. 

The script must be executable, have a name ending in .sh, and support
(even if the support is to ignore) at least the 'start' and 'stop'
commands. Most scripts seem to support "restart", but I don't recall if
it's mandatory.

Take a look at files in those directories for examples of how to set up
the files. Ports that have startup scripts include net/rsync,
sysutils/LPRng and sysutils/portupgrade.
-- 
R. Kevin Oberman, Network Engineer
Energy Sciences Network (ESnet)
Ernest O. Lawrence Berkeley National Laboratory (Berkeley Lab)
E-mail: oberman at es.net			Phone: +1 510 486-8634


More information about the freebsd-current mailing list