1

I used the solution proposed by galets in this post to add my own udev rule: How to wait for a /dev/video0 before starting a service

When Linux boots, my device is detected, and the rule creates a sys-bus-pci-drivers-mydevice.device unit. I created a service which includes the BindsTo=sys-bus-pci-drivers-mydevice.device and Requires=sys-bus-pci-drivers-mydevice.device, and the service only loads once my hardware has been detected and its driver loaded. Perfect!

My problem is that whenever I perform any systemctl command to manage any services, my device unit goes into inactive (dead) state. For example:

systemctl daemon-reload
systemctl unmask whatever.service

Once any of these are executed, if I perform systemctl status sys-bus-pci-drivers-mydevice.device, it reports:

*  sys-bus-pci-drivers-mydevice.device
   Loaded: loaded
   Active: inactive (dead)

Jan 25 09:25:41 FLABADO systemd[1]: Found device /sys/bus/pci/drivers/mydevice.

At this point, if I attempt to restart any service which includes the Requires= dependency, they fail. I have to reboot the system to recover.

I confirmed that the device is still present, its driver active, and commands that I execute that make use of the hardware all function perfectly.

I'd like to know if anyone has ever encountered this behavior, and if so, is there a way to avoid or recover from it without having to reboot?

I'm using Yocto 2.1 (Krogoth) to build my Linux distribution. Kernel version is 4.4.26-yocto-standard.

  • Does udevadm info /sys/bus/pci/drivers/mydevice after it goes inactive (vs. after it's been working) give you any hints on what happened? Please also post the version of systemd in your system, that might be helpful information too. – filbranden Jan 27 '19 at 16:28
  • udevadm info /sys/bus/pci/drivers/mydevice reports the same thing before and after the problem occurs: P: /bus/pci/drivers/mydevice E: DEVPATH=/bus/pci/drivers/mydevice E: SUBSYSTEM=drivers E: TAGS=:systemd: E: USEC_INITIALIZED=8424690 Systemd version is 229+git0+714c62b463. – Jason Cote Jan 28 '19 at 17:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.