From 49eff3c58603f3a7ed3b21665cf73df61eda5fd1 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Fri, 4 Jan 2019 15:39:26 +0100 Subject: [PATCH] blinkd: Do not wait for service startup during boot Fixes #54 When systemd-udev-trigger.service is started, it uses `/bin/udevadm settle` to trigger udevd to process the rules for discovered devices and waits until this is done. The rules file `51-blink.rules` asks udevd to run `systemctl start blinkd`. By default, `systemctl start` waits until the target service is started. `blinkd.service` has a `After=` dependency on `sysinit.target` (via `DefaultDependencies`) and waits for that. `sysinit.target` has a `After=` dependency on `systemd-udev-trigger.service` and waits for that. So we have a deadlock. Prevent deadlock by adding `--no-block` to `systemctl start`. Note 1: This fix will prevent the deadlock. However, blinkd will not start on boot currently, because it depends on python3 from a /pkg path and this is not available yet. Note 2: Same fix should be applied to `/etc/udev/rules.d/51-barcodereader.rules` --- blink/51-blink.rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blink/51-blink.rules b/blink/51-blink.rules index 6eb3792..8b3f1ca 100644 --- a/blink/51-blink.rules +++ b/blink/51-blink.rules @@ -1 +1 @@ -ACTION=="add", SUBSYSTEM=="usb", ENV{ID_VENDOR_ID}=="27b8", ENV{ID_MODEL_ID}=="01ed", MODE="0660", OWNER="2626", GROUP="598" RUN{program}="/bin/systemctl start blinkd" +ACTION=="add", SUBSYSTEM=="usb", ENV{ID_VENDOR_ID}=="27b8", ENV{ID_MODEL_ID}=="01ed", MODE="0660", OWNER="2626", GROUP="598" RUN{program}="/bin/systemctl start --no-block blinkd"