systemd, lircd, mceusb, xbmc and Arch Linux
NOTICE!!! This guide may be outdated, please check if your distro has a suitable lircd.service already.
After migrating my Arch based media center to systemd, my IR mceusb remote stopped working with lircd.
I needed to do the following steps in order to make it function again.
- Copy /usr/lib/systemd/system/lirc.service to /etc/systemd/system/lirc.service (service files in /etc/systemd/system always takes precedence to files located in /usr/lib/systemd/system).
- Edit /etc/systemd/system/lirc.service accordingly:
[Unit] Description=Linux Infrared Remote Control [Service] EnvironmentFile=/etc/conf.d/lircd.conf ExecStartPre=/usr/bin/ln -sf /dev/lirc0 /dev/lirc ExecStartPre=/usr/bin/ln -sf /run/lirc/lircd /dev/lircd ExecStart=/usr/sbin/lircd --pidfile=/run/lirc/lircd.pid Type=forking PIDFile=/run/lirc/lircd.pid [Install] WantedBy=multi-user.target
The creation of the symlink to /dev/lirc eliminates lircd errors like this:diff /etc/systemd/system/lirc.service /usr/lib/systemd/system/lirc.service 5,6d4 < EnvironmentFile=/etc/conf.d/lircd.conf < ExecStartPre=/usr/bin/ln -sf /dev/lirc0 /dev/lirc
could not get file information for /dev/lirc default_init(): No such file or directory
There may be more “correct” ways of fixing this, but creating the symlink satifies lircd. - Now adjust variables in /etc/conf.d/lircd.conf:
Get the mceusb conf here: http://lirc.sourceforge.net/remotes/mceusb/lircd.conf.mceusb and copy it to /etc/lirc/lircd.confLIRC_DEVICE="/dev/lirc0" LIRC_DRIVER="mceusb" LIRC_EXTRAOPTS="" LIRC_CONFIGFILE="/etc/lirc/lircd.conf"
- Disable lircd conflicting kernel modules by creating a blacklist file /etc/modprobe.d/blacklist_mce.conf containing:
Reboot or remove these modules using modprobe -r.# Disabling kernel modules for mce install ir_rc6_decoder /bin/false install rc_rc6_mce /bin/false install ir_rc5_decoder /bin/false
- Reenable lirc.service:
systemctl reenable lirc.service systemctl start lirc.service systemctl status lirc.service