Skip to content

Commit

Permalink
blinkd: Do not wait for service startup during boot
Browse files Browse the repository at this point in the history
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`
  • Loading branch information
donald committed Jan 4, 2019
1 parent 5e034e0 commit 49eff3c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion blink/51-blink.rules
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 49eff3c

Please sign in to comment.