leetronics / infnoise

The world's easiest TRNG to get right
Creative Commons Zero v1.0 Universal
122 stars 25 forks source link

infnoise.service: Bound to unit dev-infnoise.device, but unit isn't active. #34

Open Strykar opened 7 months ago

Strykar commented 7 months ago

The provided systemd service will not start.

$ lsusb
Bus 001 Device 004: ID 0403:6015 Future Technology Devices International, Ltd Bridge(I2C/SPI/UART/FIFO)

$ infnoise -l
ID: 0, Manufacturer: 13-37.org, Description: Infinite Noise TRNG, Serial: 1337-133733r

$ infnoise -D -n
Generated 1048576 bits.  OK to use data.  Estimated entropy per bit: 0.875594, estimated K: 1.834764
num1s:51.100801%, even misfires:0.098816%, odd misfires:0.181163%

$ sc status infnoise
○ infnoise.service - Wayward Geek InfNoise TRNG driver
     Loaded: loaded (/usr/lib/systemd/system/infnoise.service; disabled; preset: disabled)
     Active: inactive (dead)

Jan 06 10:31:13 r912 systemd[1]: infnoise.service: Bound to unit dev-infnoise.device, but unit isn't active.
Jan 06 10:31:13 r912 systemd[1]: Dependency failed for Wayward Geek InfNoise TRNG driver.

$ sudo journalctl -b -u dev-infnoise.device
Jan 13 00:28:36 r912 systemd[1]: Condition check resulted in Bridge(I2C/SPI/UART/FIFO) being skipped.
Jan 13 23:31:00 r912 systemd[1]: Expecting device /dev/infnoise...
Jan 13 23:32:30 r912 systemd[1]: dev-infnoise.device: Job dev-infnoise.device/start timed out.
Jan 13 23:32:30 r912 systemd[1]: Timed out waiting for device /dev/infnoise.
Jan 13 23:32:30 r912 systemd[1]: dev-infnoise.device: Job dev-infnoise.device/start failed with result 'timeout'.

$ sc status infnoise.device
○ infnoise.device - /infnoise
     Loaded: loaded
     Active: inactive (dead)

$ ls -l /dev/infnoise 
inode Permissions Size User Group Date Modified Name
 1001 lrwxrwxrwx     - root root   6 Jan 10:31   /dev/infnoise -> bus/usb/001/004

Running without --daemon and with --debug logs the same thing to the journal. Commenting BindsTo=dev-infnoise.device and After=dev-infnoise.device from the service unit lets the unit start.

What is binding the service to a symlink (/dev/infnoise) achieving here, and is it really required? Or how do we fix the device unit from dying?

Systemd version: 255.2 Linux r9 6.6.9-arch1-1 #1 SMP PREEMPT_DYNAMIC Tue, 02 Jan 2024 02:28:28 +0000 x86_64 GNU/Linux