rc.d startup script

rc.d startup script

Post by Dom » Wed, 20 Jul 2005 18:12:19


I am trying to get a program started up a boot time and I'm not sure how to
configure the script. The script below came from the rc.d man page.

I want to configure it to start /usr/sbin/rsyslogd and use a /etc/rc.conf
knob of rsyslogd_enable. Presently, I just start it up by typing rsyslogd at
the shell prompt. I suppose I could figure some of them out, but some of
them I have no idea about. Below is also my feeble attempt. Please help!



#!/bin/sh
#

# PROVIDE: foo
# REQUIRE: bar_service_required_to_precede_foo
# BEFORE: baz_service_requiring_foo_to_precede_it

. /etc/rc.subr

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

load_rc_config $name
run_rc_command "$1"



Feeble attempt:

#!/bin/sh
#

# PROVIDE: rsyslogd
# REQUIRE: bar_service_required_to_precede_foo #not sure
# BEFORE: baz_service_requiring_foo_to_precede_it #notsure

. /etc/rc.subr #not sure

name="rsyslogd"
rcvar=`set_rcvar` #not sure
command="/usr/sbin/rsyslogd"

load_rc_config $name #not sure
run_rc_command "$1" #not sure
 
 
 

rc.d startup script

Post by Dom » Wed, 20 Jul 2005 21:36:53

Alright, I got a little something going. Critique please. I tried to add the
line # BEFORE: SERVERS, but it wouldn't work when I added it. Works
otherwise, though.


#!/bin/sh
# PROVIDE: rsyslogd
# REQUIRE: NETWORKING

. /etc/rc.subr

name="rsyslogd"
rcvar=`set_rcvar`
command="/usr/sbin/rsyslogd"
pidfile="/var/run/rsyslogd.pid"
required_files="/etc/rsyslog.conf"

load_rc_config $name
run_rc_command "$1"