I’m running OS15.5 with LXDE minimal and have hit a head-scratcher I cannot seem to solve relating to devices being inaccessible when needed by software run via systemd.
The main example:
I am trying to use LIRC with a /dev/hiddraw device to provide remote input on an HTPC.
Everything is working as expected if I run LIRC from the command line, e.g.
lircd -H sonyir -d /dev/sonyir -e lirc
or just lircd
to use /etc/lirc/lirc_options.conf`
However, attempting to enable (or restart) the systemd unit for LIRC just yields endless logspam and no remote input:
Dec 05 17:49:20 MythTV lircd[31190]: lircd-0.10.1[31190]: Error: unable to open '/dev/sonyir'
Dec 05 17:49:20 MythTV lircd-0.10.1[31190]: Error: unable to open '/dev/sonyir'
Dec 05 17:49:21 MythTV lircd[31190]: lircd-0.10.1[31190]: Error: unable to open '/dev/sonyir'
Dec 05 17:49:21 MythTV lircd-0.10.1[31190]: Error: unable to open '/dev/sonyir'
Dec 05 17:49:22 MythTV lircd[31190]: lircd-0.10.1[31190]: Error: unable to open '/dev/sonyir'
Dec 05 17:49:22 MythTV lircd-0.10.1[31190]: Error: unable to open '/dev/sonyir'
Dec 05 17:49:23 MythTV lircd[31190]: lircd-0.10.1[31190]: Error: unable to open '/dev/sonyir'
Dec 05 17:49:23 MythTV lircd-0.10.1[31190]: Error: unable to open '/dev/sonyir'
Dec 05 17:49:24 MythTV lircd[31190]: lircd-0.10.1[31190]: Error: unable to open '/dev/sonyir'
Dec 05 17:49:24 MythTV lircd-0.10.1[31190]: Error: unable to open '/dev/sonyir'
Dec 05 17:49:25 MythTV lircd[31190]: lircd-0.10.1[31190]: Error: unable to open '/dev/sonyir'
I have, of course, granted the lirc
user permission to open the device via udev:
KERNEL=="hidraw[0-9]*", SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="00d4", SYMLINK+="sonyir", MODE="0660", GROUP="lirc"
however, even editing the lirc options conf to run as root results in this same error if running via systemd.
At first I thought this was a quirk of lirc or hidraw, but today I also noticed that mythbackend
, when started via systemd service, is also unable to open the capture card and reports tuner errors. This magically goes away when I launch it as the standard user.
Any idea what’s going on here? It’s driving me bonkers and all the permissions look correct to me (though I strongly suspect it’s a deeper issue as even root lirc via systemd fails)
crw-rw---- 1 root lirc 244, 0 Dec 5 17:43 /dev/hidraw0
crw------- 1 root root 244, 1 Dec 5 16:38 /dev/hidraw1
crw------- 1 root root 244, 2 Dec 5 16:38 /dev/hidraw2
crw------- 1 root root 244, 3 Dec 5 16:38 /dev/hidraw3