You are not logged in.
Pages: 1
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)
Offline
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.
Offline
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
Offline
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?
Offline
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.
Offline
A joke? Not at all!
I allready reinstalled acpid, with no luck.
Here is my rc.conf
Offline
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 )
Offline
Hmm, didn't work, unfortunately.
Offline
Damn!
Then i can't help you anymore, sorry.
Hope you'll get acpid working again as soon as possible!
Offline
Ahh, well thanks for trying
Maybe someone else has a take?
Offline
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.
Offline
Unfortunately, that doesn't make a difference for me
Offline
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:
[Unit]
Description=Update acpid, as to whether or not the power is on[Service]
Type=oneshot
ExecStart=/usr/local/sbin/acpidpwr-update[Install]
WantedBy=multi-user.target
to /etc/systemd/system
and a hook:
if [ "$1" = "post" ]
then
acpidpwr-update
batlife -s
fi
to /usr/lib/systemd/system-sleep/
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.
#!/bin/bash
if [[ $(acpi -a | grep on) ]]
then
onBit=1
else
onBit=0
fi
/etc/acpi/handler.sh ac_adapter AC a 0000000$onBit #the 'a' is garbage
Last edited by Bladtman242 (2012-12-03 12:09:24)
Offline
Pages: 1