Bug 1231503

Summary: lircmd only starts from command line. Will not start from systemd
Product: [Fedora] Fedora Reporter: Mark Mayfield <mayfield_mark>
Component: systemdAssignee: systemd-maint
Status: CLOSED WORKSFORME QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 22CC: johannbg, jsynacek, lnykryn, msekleta, ovasik, s, systemd-maint, zbyszek
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-06-17 10:58:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Mark Mayfield 2015-06-14 04:03:11 UTC
Description of problem:



Version-Release number of selected component (if applicable):


How reproducible:

Enable lircmd from systemd
systemctl enable lircmd.service

Steps to Reproduce:
1. Configure lirc
2. start lircmd at boot
3. 

Actual results:

does not start. Must launch from prompt
sudo lircmd -u
even starting manually from systemd on command line does nothing, logs no errors


Expected results:

works

Additional info:

I am using an oddball of an IR device. It uses ftdi_sio and generates device /dev/ttyUSB0

Had a problem with the main lircd that was very similar a couple of years ago that turned out to be an SELINUX issue. I have set selinux to permissive and started lircmd from terminal prompt and get no audit log entries, still doesn't start. The main lircd service works just fine from systemd, it is only lircmd

maybe permission issue with /dev/uinput or maybe /dev/ttyUSB0 again. Everything looks fine, and it works from the command line without issue.

Comment 1 Mark Mayfield 2015-06-14 04:07:11 UTC
On a side not. When generating a new bug from scratch. The full component listing did not show up. It was only a very small subset. I had to start the bug under base-system and then edit after creation. The result was the same in both Firefox and Chrome.

Comment 2 Jan Synacek 2015-06-17 10:50:56 UTC
Works for me. Note that I don't use any lirc configuration, but from systemd's point of view, there's nothing to fix.

# rpm -q systemd lirc
systemd-219-18.fc22.x86_64
lirc-0.9.2a-1.fc22.x86_64


# systemctl enable lircd
Created symlink from /etc/systemd/system/multi-user.target.wants/lircd.service to /usr/lib/systemd/system/lircd.service.


# systemctl reboot
...


# systemctl status lircd
● lircd.service - LIRC Infrared Signal Decoder
   Loaded: loaded (/usr/lib/systemd/system/lircd.service; enabled; vendor preset: disabled)
   Active: active (running) since Wed 2015-06-17 12:43:49 CEST; 3min 23s ago
 Main PID: 772 (lircd)
   CGroup: /system.slice/lircd.service
           └─772 /usr/sbin/lircd --nodaemon

Jun 17 12:43:49 localhost.localdomain systemd[1]: Started LIRC Infrared Signal Decoder.
Jun 17 12:43:49 localhost.localdomain systemd[1]: Starting LIRC Infrared Signal Decoder...
Jun 17 12:43:49 localhost.localdomain lircd[772]: lircd-0.9.2a[772]: Illegal effective uid: lirc: Success
Jun 17 12:43:49 localhost.localdomain lircd-0.9.2a[772]: Illegal effective uid: lirc: Success
Jun 17 12:43:49 localhost.localdomain lircd-0.9.2a[772]: Warning: config file /etc/lirc/lircd.conf contains no valid remote cont...ition
Jun 17 12:43:49 localhost.localdomain lircd-0.9.2a[772]: Notice: lircd(default) ready, using /var/run/lirc/lircd
Jun 17 12:43:49 localhost.localdomain lircd[772]: lircd-0.9.2a[772]: Warning: config file /etc/lirc/lircd.conf contains no vali...nition
Jun 17 12:43:49 localhost.localdomain lircd[772]: lircd-0.9.2a[772]: Notice: lircd(default) ready, using /var/run/lirc/lircd

Comment 3 Jan Synacek 2015-06-17 10:53:15 UTC
Aha, I just noticed that it's lircmd.service, not lircd.service. There are actually both on the system.

Comment 4 Jan Synacek 2015-06-17 10:58:17 UTC
Still, it works. The lircmd.service is socket-activated, therefore it looks as it wasn't enabled after start, but in fact its socket was.


# systemctl cat lircmd.service
# /usr/lib/systemd/system/lircmd.service
[Unit]
Description=LIRC Infrared Mouse Event Signal Decoder
Wants=lircd.socket

[Service]
Type=simple
ExecStart=/usr/sbin/lircmd  --nodaemon

[Install]
WantedBy=multi-user.target


Note the "Wants=lircd.socket". After reboot:

# systemctl status lircd.socket
● lircd.socket
   Loaded: loaded (/usr/lib/systemd/system/lircd.socket; disabled; vendor preset: disabled)
   Active: active (running) since Wed 2015-06-17 12:54:34 CEST; 10s ago
   Listen: /run/lirc/lircd (Stream)


# systemctl status lircmd.service
● lircmd.service - LIRC Infrared Mouse Event Signal Decoder
   Loaded: loaded (/usr/lib/systemd/system/lircmd.service; enabled; vendor preset: disabled)
   Active: inactive (dead) since Wed 2015-06-17 12:54:34 CEST; 17s ago
  Process: 633 ExecStart=/usr/sbin/lircmd --nodaemon (code=exited, status=0/SUCCESS)
 Main PID: 633 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/lircmd.service


If lircd/lircmd still doesn't work for you, please feel free to reopen this bug and reassign to "lirc" component.