acerfand in Ubuntu 9.04 Jaunty

As some of you might notice, the script acerfand (fan control for Acer Aspire One) doesn’t run automatically in th newest Ubuntu 9.04 when you add its path to your rc.local. I don’t know why, but the file rc.local behaves differently from previous version during booting (it looks like it’s not executed, but in fact it is, and when I run it manually after I log in everything works).

How did I fix it? Instead of the line:

/usr/local/bin/acerfand

in my /etc/rc.local file, I added:

start-stop-daemon –start –name acerfand –startas /usr/local/bin/acerfand –background

Now the acerfand script is executed at startup. I hope this tip may be helpful for somebody.

EDIT:  There should be double minuses before –start, –name, —startas and –background, but – as Erwin noticed – wordpress transforms double minus into dash.

Advertisements

13 Responses to acerfand in Ubuntu 9.04 Jaunty

  1. Ben Griggs says:

    Ah, I’ve been wondering why I had to manually run the script. Off to try now, thanks!

  2. Paul says:

    I have the same problem, but this solution doesn’t work for me – the fan keeps on chugging along till I do a “sudo acerfand” manually… Strange

  3. mike987 says:

    @Ben Griggs: You’re welcome!

    @Paul: Maybe your rc.local file doesn’t have execution rights? Does it work when you do “sudo /etc/rc.local”?

  4. Erwin says:

    Mike – thanks for this. I managed to get your suggested solution to work, but with a minor change. This is the line of code I’ve added to /etc/rc.local:

    start-stop-daemon –start –name acerfand –startas /usr/local/bin/acerfand –background

    Note the “double minuses”.

  5. Erwin says:

    Ah – this is what WordPress is doing when publishing log entries and comments. Note that in the statement Mike suggests, all option flags (start, name, startas and background) need be prefixed with double minuses.

  6. TomAstoria says:

    I fixed the /etc/rc.local as suggested. Nothing changed. Acerfand still works if I open a terminal and sudo acerfand. Nothing else works for me.

    Any other ideas? Thanks for your efforts

  7. TomAstoria says:

    I tried again with the “double minuses” as noted in the post above (for some reason, the post itself doesn’t print double minuses!) and now it does seem to start automatically. Quiet once again. Thanks to all

  8. Erwin says:

    After updating the /etc/rc/local file it seemed to work. After some time, I noticed that the fan speed was constant again. I have just rebooted the machine, and in the log, acerfand writes “acerfand is already running”. When I start acerfand from the terminal after booting, it will fire up.

    For some reason, the condition “pgrep acerfand | grep -v $$ > /dev/null” (contained in acerfand) returns true, which results in the script exiting because it assumes it is running already.

    My knowledge of grep and pgrep is not sufficient. Nor am I exactly sure what the semantics of the test are. It looks like the condition evaluates to true during the startup process, where it evaluates to false when started from a terminal.

    I have solved this by commenting out the exit-statement (near line 75), and by promising myself not to start acerfand from a terminal anymore (i.e. letting the rc.local file be the only place from which the script is starte).

    Anyone has ideas about the cause and a real solution? Thanks in advance.

  9. Erwin says:

    me again 🙂

    I have noticed that this ruddy acerfand-script is indeed started twice upon boot. The first second of their existence, both instances produce exactly the same log messages. Then, one of the instances exits, probably due to strange return codes.

    Will do some more tests to find out how often /etc/rc.local is executed during startup.

  10. jk says:

    Most useful. thanks.

  11. Mark says:

    Mike, your post update should include ‘start’ in the double dash list. It looks like you left that one out.

  12. mike987 says:

    Thanks, Mark. I re-updated the post.

  13. Szabolcs says:

    Dear All,

    thank u all for the great posts! Unfortunately, I was updating the system by reading the posts one by one, so I experienced the same problems (–, -, etc) which u did. When I got to the end of this page, however… it worked!
    thank you again

    Sz

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: