I had the same symptoms, lirc would not work when run as a service, but would work as a command. Note that in my case some of the keys worked, but only when lirc was not running (neither as a service nor a command).
The problem was that evdev (an input driver for Xorg) was picking up the remote as a keyboard input device. Getting evdev to ignore the remote solved the problem for me. I guess that the lirc service start script got hung up by the fact that evdev had a handle on the remote, somehow.
The problem is detailed in this thread: http://www.tbsdtv.com/forum/viewtopic.php?f=22&t=2896&sid=f8d407bf0e7a02db70439a41ea2adc3c
The following is from the last post in that thread. Note: TBS6981 is the satellite tuner which I was using as my remote receiver.
The problem was caused by evdev (an input driver for Xorg) which was picking up the remote as a keyboard input device. This could be seen from my Xorg logs (/var/log/Xorg...), see below. Most of the buttons don't work by default because they don't naturally map to keyboard buttons, e.g. your keyboard doesn't have an EPG key, but it does have numbers and direction keys.
There are basically two solutions
- Configure evdev to ignore the IR input and use lirc OR
- Remap the remote buttons to keyboard keys, as discussed in this post, and don't use lirc
evdev can be configured to ignore the TBS6981 as a keyboard by adding the following to the end of /usr/share/X11/xorg.conf.d/10-evdev.conf -
Section "InputClass"
Identifier "cx23885 IR (TurboSight TBS 6981)"
MatchProduct "cx23885 IR (TurboSight TBS 6981)"
MatchIsKeyboard "on"
Option "Ignore"
EndSection
Note that MatchProduct above matches the identifier found in Xorg.0.log.
This is an extract from Xorg.0.log showing evdev picking the remote input, these lines do not appear if evdev is correctly configured to ignore the remote as a keyboard:
[ 21.486] (II) config/udev: Adding input device cx23885 IR (TurboSight TBS 6981) (/dev/input/event3)
[ 21.486] (**) cx23885 IR (TurboSight TBS 6981): Applying InputClass "evdev keyboard catchall"
[ 21.486] (II) Using input driver 'evdev' for 'cx23885 IR (TurboSight TBS 6981)'
[ 21.486] (II) Loading /usr/lib/xorg/modules/input/evdev_drv.so
[ 21.486] (**) cx23885 IR (TurboSight TBS 6981): always reports core events
[ 21.486] (**) evdev: cx23885 IR (TurboSight TBS 6981): Device: "/dev/input/event3"
[ 21.486] (--) evdev: cx23885 IR (TurboSight TBS 6981): Vendor 0x6981 Product 0x8888
[ 21.486] (--) evdev: cx23885 IR (TurboSight TBS 6981): Found keys
[ 21.486] (II) evdev: cx23885 IR (TurboSight TBS 6981): Configuring as keyboard
[ 21.486] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:04.0/0000:02:00.0/rc/rc0/input3/event3"
[ 21.486] (II) XINPUT: Adding extended input device "cx23885 IR (TurboSight TBS 6981)" (type: KEYBOARD, id 8)
So, first step is look for lines in your /var/log/Xorg.0.log showing evdev picking up your remote receiver, then configure
/usr/share/X11/xorg.conf.d/10-evdev.conf to ignore the receiver using the id for the receiver as found in Xorg.0.log.
sudo
forservice lirc start
?