Bandwidthd at startup question

I have a stupid question, for whatever reason I can't get bandwidthd to start at boot. I always have to start it manually. How do I get it to start at boot time?
 
Well, I tried that before I posted on the thread, and I tried it exactly how this reply went, and I get this error,

Code:
/etc/rc: WARNING: Ignoring old-style startup script /etc/rc.d/bandwidthd.sh

I have FreeBSD 9.1, and installed bandwidth from ports if that matters.

Dana
 
danaeckel said:
Well, I tried that before I posted on the thread, and I tried it exactly how this reply went, and I get this error,

Code:
/etc/rc: WARNING: Ignoring old-style startup script /etc/rc.d/bandwidthd.sh

I have FreeBSD 9.1, and installed bandwidth from ports if that matters.

Dana

In short, no keeping `.sh' suffix. See rc(8).

Please, rename file:
Code:
# cd /usr/local/etc/rc.d/
# mv bandwidthd.sh bandwidthd

*EDIT*

Other possibility is create an rc.d script controlled with rc.conf(5) as follows:
Code:
#!/bin/sh
#
# PROVIDE: utility
# REQUIRE: DAEMON
# KEYWORD: shutdown

. /etc/rc.subr


name="bandwidthd"
rcvar=`set_rcvar`
command="/usr/local/bandwidthd/bandwidthd"

load_rc_config $name

utility_enable=${utility_enable-"NO"}
utility_pidfile=${utility_pidfile-"/var/run/utility.pid"}

pidfile="${utility_pidfile}"

run_rc_command "$1"

Add this line to /etc/rc.conf
Code:
bandwidthd_enable="YES"

Run to start without reboot:
# /usr/local/etc/rc.d/bandwidthd start

I recommend you to read as reference document Practical rc.d scripting in BSD.
 
Thank you. when I created the script and ran through rc.conf that worked perfectly. When I removed the .sh, that method gave me a prefix error.

Dana
 
Back
Top