Bug#791412: systemd invoking a service on its own

Michael Biebl biebl at debian.org
Sat Jul 4 15:24:42 BST 2015


Control: reassign -1 laptop-mode-tools

Am 04.07.2015 um 15:44 schrieb Michael Biebl:
> Am 04.07.2015 um 15:35 schrieb Ritesh Raj Sarraf:
>> Package: systemd
>> Version: 220-7
>> Severity: normal
>>
>>
>> I have a .service defined for laptop-mode-tools
>>
>> rrs at chutzpah:~$ cat /lib/systemd/system/laptop-mode.service 
>> [Unit]
>> Description=Laptop Mode Tools
>>
>> [Service]
>> Type=oneshot
>> #RemainAfterExit=no
>> ExecStart=/usr/sbin/laptop_mode init auto
>> ExecStop=/usr/sbin/laptop_mode init stop
>> ExecStopPost=/bin/rm -f /var/run/laptop-mode-tools/enabled
>> StandardOutput=tty
>> StandardError=tty
>>
>> [Install]
>> WantedBy=multi-user.target
>>
>>
>>
>> Do you see the following behavior of systemd to be normal ?
>> I have no idea as to why it is invoking laptop-mode-tools every 22 seconds.
> 
> I'm pretty sure it's not systemd triggering the start request on it's
> own. Do you install any acpi/apm/udev rules hooks? If so, I'd start
> looking there.

laptop-mode-tools: /etc/acpi/actions/lm_ac_adapter.sh
laptop-mode-tools: /etc/acpi/actions/lm_battery.sh
laptop-mode-tools: /etc/acpi/actions/lm_lid.sh
laptop-mode-tools: /etc/acpi/events/lm_ac_adapter
laptop-mode-tools: /etc/acpi/events/lm_battery
laptop-mode-tools: /etc/acpi/events/lm_lid
laptop-mode-tools: /etc/apm/event.d/laptop-mode
laptop-mode-tools: /etc/power/event.d/laptop-mode
laptop-mode-tools: /etc/power/scripts.d/laptop-mode
laptop-mode-tools: /lib/systemd/system/laptop-mode.service
laptop-mode-tools: /lib/udev/lmt-udev
laptop-mode-tools: /lib/udev/rules.d/99-laptop-mode.rules
laptop-mode-tools: /usr/lib/pm-utils/sleep.d/01laptop-mode

I bet the start requests are triggered by one of those scripts.

If repeated start attempts by those scripts are a problem, then this is
something which needs to be addressed in l-m-t.

> 
>> Another problem is:
>> The ExecStart script executes /usr/sbin/laptop_mode, which internally backgroups another script, after acquiring a persistent lock.
>> For what I've debugged so far, it turns out systemd quietly kills (or does not allow invocation of)  scripts that are backgrounded
> 
> Type=oneshot is not supposed to be used for processes which background.

You are using Type=oneshot without RemainAfterExit=yes.
For Type=oneshot, systemd will launch all ExecStart= lines, and proceed
once the spawned process(es) have exited (see the systemd.service).

Without RemainAfterExit=yes, your service will be inactive (dead) and
systemd will cleanup the complete cgroup.This is the default behaviour
(see man systemd.kill, KillMode defaults to control-group)

So issue number one is a l-m-t triggered problem afaics and issue number
two is expected behaviour.

Thus reassign to l-m-t for issue number one.


Regards,
Michael

-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?

-------------- 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/20150704/2c7f1a7d/attachment-0002.sig>


More information about the Pkg-systemd-maintainers mailing list