Saturday, 1 October 2011

Update to the fancontrol script

One final annoyance when starting up the qnap was that my /etc/rc.local never finished and so the led at the front of the box would never settle down to all green.

Now that I am happy with the scripts I thought I would make them into a daemons. A quick google led to Tony's Cafe blog who described beautifully how to create a debian script for the fancontrol. So I modified his instructions slightly:

Copy /etc/init.d/skeleton to /etc/init.d/fancontrol

Edit /etc/init.d/fancontrol

Change:
NAME=fancontrol
DAEMON=/usr/local/sbin/$NAME
DAEMON_ARGS=""
All seemed to be fine except that when I ran /etc/init.d/fancontrol the script would just hang... A bit more googling made me realise that I was no longer running '/usr/local/sbin/fancontrol &' I was running it without the & flag. A quick modification to the start of my fancontol script to have this at the top (take from linuxquestions) :
if [ "x$1" != "x--" ]; then
$0 -- 1> /dev/null 2> /dev/null &
exit 0 fi

No comments:

Post a Comment