[systemd-devel] Wanted service in status deactivating

Liu, Shuang (ADITG/ESM) sliu at de.adit-jv.com
Wed Jan 9 16:04:07 UTC 2019


Can someone give me some advice? Thanks.

Shuang Liu

-----Original Message-----

Hi,

What happens if a wanted service in status deactivating (stop)?

For example, in the service A an ExecStop= is defined and takes 0.5s.
Then what should happen if a service B is started and A is WantedBy B during the 0.5s.

Concrete scenario is:
A USB device has defined the udev rule SYSTEMD_WANTS=A.service and is bind to B.device.
It works normally as expected:
	When connect the device, the A.service is started.
	When disconnect, the A.service is stopped.

However, if quick disconnect/connect the device (<0.5s), A.service stay in stopped and will not be restarted.
Probably when connecting, the service is in deactivating and the Wants will be hence ignored.

Best regards

Shuang Liu


More information about the systemd-devel mailing list