You are not logged in.

#1 2012-04-20 20:43:53

Bladtman242
Member
Registered: 2012-02-14
Posts: 127

[SOLVED] acpid handler doesn't run at boot

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 smile
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

#2 2012-04-21 09:55:44

Bladtman242
Member
Registered: 2012-02-14
Posts: 127

Re: [SOLVED] acpid handler doesn't run at boot

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

#3 2012-04-21 10:13:41

nierro
Member
From: Milan, Italy
Registered: 2011-09-02
Posts: 849

Re: [SOLVED] acpid handler doesn't run at boot

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

#4 2012-04-21 14:24:59

Bladtman242
Member
Registered: 2012-02-14
Posts: 127

Re: [SOLVED] acpid handler doesn't run at boot

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 smile

I hope I'm making sense?

Offline

#5 2012-04-21 16:50:13

nierro
Member
From: Milan, Italy
Registered: 2011-09-02
Posts: 849

Re: [SOLVED] acpid handler doesn't run at boot

Is this a joke? smile
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

#6 2012-04-21 17:23:37

Bladtman242
Member
Registered: 2012-02-14
Posts: 127

Re: [SOLVED] acpid handler doesn't run at boot

A joke? Not at all! smile
I allready reinstalled acpid, with no luck.
Here is my rc.conf

Offline

#7 2012-04-21 17:29:50

nierro
Member
From: Milan, Italy
Registered: 2011-09-02
Posts: 849

Re: [SOLVED] acpid handler doesn't run at boot

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 big_smile )

Offline

#8 2012-04-22 01:50:15

Bladtman242
Member
Registered: 2012-02-14
Posts: 127

Re: [SOLVED] acpid handler doesn't run at boot

Hmm, didn't work, unfortunately.

Offline

#9 2012-04-22 08:06:43

nierro
Member
From: Milan, Italy
Registered: 2011-09-02
Posts: 849

Re: [SOLVED] acpid handler doesn't run at boot

Damn!
Then i can't help you anymore, sorry.
Hope you'll get acpid working again as soon as possible! smile

Offline

#10 2012-04-22 08:33:56

Bladtman242
Member
Registered: 2012-02-14
Posts: 127

Re: [SOLVED] acpid handler doesn't run at boot

Ahh, well thanks for trying smile
Maybe someone else has a take?

Offline

#11 2012-04-24 20:22:33

pixy
Member
Registered: 2011-11-09
Posts: 9

Re: [SOLVED] acpid handler doesn't run at boot

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

#12 2012-04-26 11:51:37

Bladtman242
Member
Registered: 2012-02-14
Posts: 127

Re: [SOLVED] acpid handler doesn't run at boot

Unfortunately, that doesn't make a difference for me hmm

Offline

#13 2012-12-03 12:05:01

Bladtman242
Member
Registered: 2012-02-14
Posts: 127

Re: [SOLVED] acpid handler doesn't run at boot

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.

acpidpwr-update wrote:

#!/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

Board footer

Powered by FluxBB