I'm not sure if this is a laptop thing, but here goes:
A few months back I installed acpid and set up the /etc/acip/handler.sh script to manage things like cpu governors etc.
And I think it's pretty awesome too
The thing is, for some reson, it doesnt run at boot anymore. I'ts in my rc.conf file, and it's listed by rc.d list as STARTED AUTO.
It also works whenever I plug/unplug the power cord, and I can manually trigger it by doing something like
sudo /etc/acpi/handler.sh ac_adapter AC a 00000000
But it'd be great if I didn't have to.
Last edited by Bladtman242 (2012-12-03 12:05:16)
Just to be clear: it used to so by itself, and then it suddenly stopped for some reason.
It's quite annoying that, at boot, the system just assumes it in the the same state (plugged/unplugged, battery/no battery etc.), as it was at shutdown.
I assume that acpid is responsible for making the proper events at boot, but I don't actually know.
Only to understand if acpid works: try to run the daemon during your session and then to switch power supply on and off, and see if it manages something.
sudo /etc/rc.d/acpid restart
It does, it also works without restarting the daemon. the daemon is actually working perfectly fine, except that it isn't 'updated' at boot.
It registers events just fine, but only when they occur. Which means that, after boot, the machine doesn't know what state it is in, until that state changes. (There is a quantum-physics joke in here somewhere)
Previously, this wasn't the case. It would be notified sometime during the startup/boot process and hence know it's current state, rather than continuing by the the assumption that it was in the same state as before shutting down
I hope I'm making sense?
Is this a joke?
Ok, now i understand...but i only can't imagine a solution, it seems a software problem. But the strange is that you're alone with this kind of problem!
Try to install acpid again...or try to post your rc.conf, these are the only solutions i come up with.
A joke? Not at all!
I allready reinstalled acpid, with no luck.
Here is my rc.conf
try to make acpid starts just before dbus (yeah it seems it must be started before it) and not in background.
Then we'll see if something happens (i'll keep fingers crossed )
Hmm, didn't work, unfortunately.
Then i can't help you anymore, sorry.
Hope you'll get acpid working again as soon as possible!
Ahh, well thanks for trying
Maybe someone else has a take?
Actually acpid behaves weird for me too. When i run it at boot it doesnt detect any rules I have set in my configs, and so none of my laptop fn keys work since I use acpid to start most things with them. But, when i start acpid with X session suddenly my custom files work without problems. I use awesome wm and i start acpid from awesome's own config file like this:
sudo /etc/rc.d/acpid stop && sleep 2 && sudo /etc/rc.d/acpid start
Also if I start it with rc.d like this:
sudo rc.d restart acpid
acpid also refuses to load any custom rules.
I have no idea why this line isnt working but since it works if I start it with the line above I really didnt care much to find out why.
Yeah I'm kinda lazy but I hope I helped you out with this. Atleast a little bit.
Unfortunately, that doesn't make a difference for me
Reviving for completeness:
It turns out this is actually the natural behaviour of acpid. (I ended up contacting one of the devs) It doesn't obtain a state at boot.
The solution in my case (now having switched to systemd) was to add a unit:
Description=Update acpid, as to whether or not the power is on
and a hook:
if [ "$1" = "post" ]
Where acpidpwr-update is just a script that uses acpi to determine whether or not the power cord is plugged in, and call /etc/acpi/handler.sh as to emulate a plug/unplug event.
if [[ $(acpi -a | grep on) ]]
/etc/acpi/handler.sh ac_adapter AC a 0000000$onBit #the 'a' is garbage
Last edited by Bladtman242 (2012-12-03 12:09:24)