Why won't my script run?

Mark Greenwood fatgerman at ntlworld.com
Sat Mar 14 17:07:21 UTC 2009


Another question for the boffins..

My Acer Aspire One needs a special script to control the fan. This script is called /usr/local/bin/acerfand and, when I run it from the command line it does indeed control the fan. acerfand is a bash script which daemonises itself using magic I do not understand.

To get it to start at boot I'm instructed to place the command line into /etc/rc.local, so ignoring comments my /etc/rc.local now looks like

#!/bin/sh -e
/usr/local/bin/acerfand
exit 0

If I run 'sudo /etc/rc.local' from the command line my fan script starts running, the fan is being controlled and I can see acerfand as a running process.

On boot however, the script starts and then immediately exits (I put debug in, I can see it in syslog starting up and then exiting). There is no running process called acerfand after boot. Again, I type 'sudo /etc/rc.local' at a command line and now there is a running acerfand process.

Why the different behaviour at boot, and how can I make it work?

It worked on Mandriva.... ;)

Thanks,

Mark




More information about the kubuntu-users mailing list