Bug#791412: systemd invoking a service on its own

Ritesh Raj Sarraf rrs at debian.org
Sun Jul 5 18:58:33 BST 2015


Control: reassign -1 laptop-mode-tools


Hello Michael,


On Sunday 05 July 2015 07:18 PM, Michael Biebl wrote:
>> LMT can be invoked multiple ways. Through systemd, through acip and
>> through udev, which is the most common invoking parent.
> 
> 
> Even if the trigger is e.g. acpid or udev, the activation should go
> through systemd, e.g. by using systemctl or SYSTEMD_WANTS.
> 
>

Thanks. Then I'm doing the right thing here already.

>> No. I'm just not making it depend on systemd. It should work on systems
>> without systemd too.
> 
> That's a difference. You can still make use of systemd when available.
>

Yes. I need to spend more time understanding systemd.

>> By the way, I think in version 221, something more may have broken for
>> systemd in general. The udev rules don't seem to be processed, nor the
>> commands invoked. Reverting to 220, and the processing/invocation works
>> back.
>>
>> Both LMT and systemd upgraded around the same time, and I took it as a
>> bug in LMT. :-)
> 
> It is a bug in lmt. You can't spawn long running, daemonized processes
> from udev rules under systemd. They are killed by udevd.
> man 7 udev is quite clear about that:
> 
> 
>            Starting daemons or other long-running processes is not
> appropriate for udev; the forked processes, detached or not, will
>            be unconditionally killed after the event handling has finished.
> 
> 
> If that worked in the past, then only by accident.
> 
> 

Okay! Thank you. That explains that silent killing of the backgrounded
process. I'll study it later to see how lmt can fit it with it.


By the way, I did figure out the repetitive invocation, that initially
looked like systemd calling.

Turns out the kernel/udev has changed (or I'd rather say improved) the
way it measures the power_supply subsystem. Now, it is capable on
emitting events, when the charge of the battery changes.

That is what was causing multiple events, thus leading to multiple
invocations of lmt.

I've fixed it in my code, and so have reassigned this bug back to lmt.

Thank you for your help.

-- 
Ritesh Raj Sarraf | http://people.debian.org/~rrs
Debian - The Universal Operating System

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20150705/69881a7f/attachment-0002.sig>


More information about the Pkg-systemd-maintainers mailing list