For anyone having errors running "start" or "stop" for /etc/init.d/fancontrol, please use this as your /etc/init.d/fancontrol file:
Code:
#!/bin/sh
#
# Fancontrol start script.
#
set -e
# Defaults
DAEMON=/usr/sbin/fancontrol
PIDFILE=/var/run/fancontrol.pid
PATH=/sbin:/bin:/usr/sbin:/usr/bin
test -f $DAEMON || exit 0
. /lib/lsb/init-functions
case "$1" in
start)
log_begin_msg "Starting fancontrol daemon..."
start-stop-daemon --start -o -q -m -b --pidfile $PIDFILE -x $DAEMON
log_end_msg $?
;;
stop)
log_begin_msg "Stopping fancontrol daemon..."
start-stop-daemon --stop -o -q --pidfile $PIDFILE
log_end_msg $?
;;
force-reload|restart)
sh $0 stop
sh $0 start
;;
*)
log_success_msg "Usage: /etc/init.d/fancontrol {start|stop|restart|force-reload}"
log_success_msg " start - starts system-wide fancontrol service"
log_success_msg " stop - stops system-wide fancontrol service"
log_success_msg " restart, force-reload - starts a new system-wide fancontrol service"
exit 1
;;
esac
exit 0
What I changed is the code below, instead of having...
start-stop-daemon --start -o -q -m -b -p $PIDFILE -x $DAEMON
start-stop-daemon --stop -o -q -p $PIDFILE
I made it have...
start-stop-daemon --start -o -q -m -b --pidfile $PIDFILE -x $DAEMON
start-stop-daemon --stop -o -q --pidfile $PIDFILE
This allowed me to start/stop the daemon properly!
Bookmarks