Am 07.04.2013 19:35, schrieb Tzafrir Cohen:
> Package: systemd
> Version: 44-11
> Severity: normal
>
> Note: I'm note completely sure this is a bug of systemd. If not, feel
> free to close it.
>
> I have a Wheezy-based system with systemd.
>
> One of the services has configuration similar to:
>
> # device-activated.service
> [Unit]
> Description=Device-activated Service
> StopWhenUnneeded=true
>
> [Service]
> ExecStart=/usr/sbin/the-daemon
> Restart=always
>
>
> with the following udev rule:
>
> SUBSYSTEM=="usb", ACTION=="add", \
> ENV{PRODUCT}=="1234/5678/*", ENV{DEVTYPE}!="usb_interface", \
> TAG+="systemd", \
> ENV{SYSTEMD_WANTS}="device-activated.service"
>
> The result is that when the device with the right vendor/product ID is
> plugged in, systemd "wants" the service and it is run. When it is
> unplugged, systemd no longer wants it and the service is stopped.
>
>
> However it seems that 'systemctl daeomn-reload' resets the state of
> systemd.
>
> 'systemctl daemon-reload' is also run automatically is
> '/etc/init.d/someservice' is run from a dpkg maintaier script (through
> /lib/lsb/init-functions.d/40-systemd , assuming that the script sources
> the lsb functions). Which makes our service stop on quite a few package
> upgrades.
>
> Should this be considered a bug of systemd? If so: any hope of fixing it
> any time soon?I don't think StopWhenUnneeded does what you think it should do: Quoting man 5 systemd.unit "If this option is set, a unit will be automatically cleaned up if no other active unit requires it." Is this actually what you want? To me it looks like you want to make the service stop when the device is unplugged. For that you should use BindTo=<device> Michael -- Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?
signature.asc
Description: OpenPGP digital signature

