Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 463944 - >=app-laptop/laptop-mode-tools-1.62-r1 kills acpid while killing lm-polling-daemon
Summary: >=app-laptop/laptop-mode-tools-1.62-r1 kills acpid while killing lm-polling-d...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Alon Bar-Lev (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-30 23:32 UTC by Murray Campbell
Modified: 2013-05-11 10:08 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Murray Campbell 2013-03-30 23:32:33 UTC
>=app-laptop/laptop-mode-tools-1.62-r1 installs the files lm_ac_adapter.sh and lm_battery.sh into /etc/acpi/actions.

When these are triggered by the AC adapter being plugged or un-plugged and when ENABLE_BATTERY_LEVEL_POLLING=1 is set in /etc/laptop-mode/conf.d/battery-level-polling.conf then "/usr/sbin/laptop_mode auto" is called.

In version 1.60 this would (on going to AC) issue "killall -q lm_polling_daemon"

In version 1.62 this has been changed to "killall -g -q lm_polling_daemon".

Unfortunately this means that if the polling daemon was started by a previous ACPI event it will be in the same process group as acpid which means that acpid will also be killed.
Comment 1 Ritesh Raj Sarraf 2013-04-02 06:09:37 UTC
I checked it everywhere, and I don't see killall being called with the -g switch.
I am not sure how that is there in your src.

https://github.com/rickysarraf/laptop-mode-tools/blob/lmt-upstream/usr/share/laptop-mode-tools/modules/battery-level-polling
Comment 2 Alon Bar-Lev (RETIRED) gentoo-dev 2013-04-02 06:24:18 UTC
Thank you Ritesh.

Murray Campbell: please use the app-laptop/laptop-mode-tools-1.63-r1 version and check it out, it was just released after a while and is synced with upstream repository.
Comment 3 Murray Campbell 2013-04-17 05:53:04 UTC
Apologies for the delay.

I can confirm that app-laptop/laptop-mode-tools-1.63-r1 has the same problem.

I should have been more specific in my report.

What happens is this:

If the AC cable is plugged in then /etc/acpi/actions/lm_ac_adapter.sh is run by acpid which in turn runs '/usr/sbin/laptop_mode auto'.

This will, on line 1133, kill the polling daemon with 'killall -g -q lm-polling-daemon'.  

If one then removes the AC cable acpid will run /etc/acpi/actions/lm_battery.sh which again runs '/usr/sbin/laptop_mode auto'.

This time the script checks to see if the polling daemon is running and, if not, starts it again - now in the process group of acpid.

Now if one plugs the AC back in, the killall is executed and acpid is killed.
Comment 4 Ritesh Raj Sarraf 2013-04-17 06:39:33 UTC
Thank you for nailing this Murray. I can't recollect why this change was added. For now, I will revert it
Comment 5 Alon Bar-Lev (RETIRED) gentoo-dev 2013-05-11 10:08:18 UTC
Ok, fixed in laptop-mode-tools-1.63-r2.

Thanks!