<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"><html><head><meta name="qrichtext" content="1" /><style type="text/css">p, li { white-space: pre-wrap; }</style></head><body style=" font-family:'DejaVu Sans'; font-size:9pt; font-weight:400; font-style:normal;">On Saturday 14 March 2009 12:07:21 pm Mark Greenwood wrote:<br>
> Another question for the boffins..<br>
><br>
> My Acer Aspire One needs a special script to control the fan. This script<br>
> is called /usr/local/bin/acerfand and, when I run it from the command line<br>
> it does indeed control the fan. acerfand is a bash script which daemonises<br>
> itself using magic I do not understand.<br>
><br>
> To get it to start at boot I'm instructed to place the command line into<br>
> /etc/rc.local, so ignoring comments my /etc/rc.local now looks like<br>
><br>
> #!/bin/sh -e<br>
> /usr/local/bin/acerfand<br>
> exit 0<br>
><br>
> If I run 'sudo /etc/rc.local' from the command line my fan script starts<br>
> running, the fan is being controlled and I can see acerfand as a running<br>
> process.<br>
><br>
> On boot however, the script starts and then immediately exits (I put debug<br>
> in, I can see it in syslog starting up and then exiting). There is no<br>
> running process called acerfand after boot. Again, I type 'sudo<br>
> /etc/rc.local' at a command line and now there is a running acerfand<br>
> process.<br>
><br>
> Why the different behaviour at boot, and how can I make it work?<br>
><br>
> It worked on Mandriva.... ;)<br>
><br>
> Thanks,<br>
><br>
> Mark<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>It would be easier to copy your fan control script into the /etc/init.d directory and then add it to the /etc/rc#.d/ as a softlink with either "S##acerfan" or "K##acerfan"  (s is for start and the number is the order in which you want it to start, K is for kill or stop, and again the number indicates when you want it to stop relative to the other K's in the directory.).<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>create a "acerfan" file (using /bin/bash instead of sh as its default on most Debian based distros) in /etc/init.d with the contents of what you put in rc.local (leaving off the "exit 0" line).<br>
then softlink the script in rc2.d (default runlevel in Debian based distros) as follows:<br>
ln -s /etc/init.d/acerfan /etc/rc2.d/S99acerfan<br>
ln -s /etc/init.d/acerfan /etc/rc6.d/K03acerfan<br>
that last line is optional.<br>
Then see what happens.<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>-- <br>
See Ya'<br>
Howard Coles Jr.<br>
John 3:16!<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p></body></html>