Thursday, April 10, 2014

FreeBSD: startup scripts


most scripts that get stuffed in /usr/local/etc/rc.d are "native" FreeBSD startup scripts in that they have been written around the FreeBSD startup API
thing - however - if you do not use that recipe for doing start up scripts and you just want a plain traditional old startup script, then you need to
make sure that the script has a .sh extension eg.

flogster:/usr/local/etc/rc.d # dir lat.sh
-rwxr-xr-x 1 root wheel 821 Feb 7 13:31 lat.sh*


yes, I couldn't get lat to start at boot-time until I renamed the startup script

flogster:/usr/local/etc/rc.d # mv lat lat.sh


failing this you've got to write them in this style....

from "man rc"


EXAMPLES
The following is a minimal rc.d/ style script. Most scripts require
little more than the following.

#!/bin/sh
#

# PROVIDE: foo
# REQUIRE: bar_service_required_to_precede_foo

. /etc/rc.subr

name="foo"
rcvar=`set_rcvar`
command="/usr/local/bin/foo"

load_rc_config $name
run_rc_command "$1"

No comments:

Post a Comment