Bug 1268675 - /run/lirc owner lirc; failed lircd socket/lircd.pid
Summary: /run/lirc owner lirc; failed lircd socket/lircd.pid
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: lirc
Version: 23
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Alec Leamas
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-10-04 15:53 UTC by Ronald L Humble
Modified: 2016-03-20 00:53 UTC (History)
5 users (show)

Fixed In Version: lirc-0.9.2a-3.fc22
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-12-03 22:48:44 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Ronald L Humble 2015-10-04 15:53:12 UTC
Description of problem:
lircd socket and lircd.pid are not created, perhaps due to /run/lirc user:group being lirc:lirc instead root:root
Hardware can not use lirc.

Version-Release number of selected component (if applicable):
Not sure what creates /run/lirc. System is fc23 with updates-testing enabled.

How reproducible:
Boot system with lircd enabled or start manually

Steps to Reproduce:
1.
2.
3.

Actual results:
drwxr-xr-x. 2 lirc lirc 40 Oct  4 11:15 /run/lirc

Expected results:
ls -al /run/lirc/
total 4
drwxr-xr-x.  2 root root   80 Oct  4 11:40 .
drwxr-xr-x. 49 root root 1380 Oct  4 11:36 ..
srw-rw-rw-.  1 root root    0 Oct  4 11:40 lircd
-rw-r--r--.  1 root root    6 Oct  4 11:40 lircd.pid


Additional info:

Comment 1 Fedora Update System 2015-11-24 15:43:48 UTC
lirc-0.9.2a-3.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2015-04e120e5f0

Comment 2 Alec Leamas 2015-11-24 15:47:06 UTC
Indeed, thanks for reporting. This is due to the relevant scriptlets (notably %pre) not being executed. A manual work-around is described in bug #1279742.

Comment 3 Fedora Update System 2015-11-26 02:26:11 UTC
lirc-0.9.2a-3.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update lirc'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-04e120e5f0

Comment 4 Fedora Update System 2015-12-03 22:48:39 UTC
lirc-0.9.2a-3.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.

Comment 5 Ronald L Humble 2016-02-26 21:55:15 UTC
I know this is not a help desk, but the problem persists for me. Fully updated fc23, upgraded from alpha; lirc-compat-0.9.3a-3.fc23.x86_64.

After reboot I must manually change /var/run/lirc ownership from lirc:lirc to root:root before running "systemctl start lirc".

Comment 6 Alec Leamas 2016-02-28 07:45:32 UTC
Odd, indeed, as they say. Have you modified the systemctl scripts somehow? (added scripts to /etc/systemd/system).

As shipped, the lirc daemon runs as user 'lirc', and the /var/run/lirc ownership is thus lirc:lirc. Things will change if you change the /etc/lirc/lirc_options.conf so that the service runs as root, or if you modify the lircd.service file.

It seems like your lircd daemon runs as root(?). Why, then? 

What are the symptoms if you not change the /var/run/lircdownership?

Comment 7 Ronald L Humble 2016-02-28 16:20:05 UTC
Unless you like a good mystery, if I am the only one complaining, let's drop it. 

I have a work-around. I will do a bare metal install of fc24 Alpha in March. Hopefully the problem disappears. Absolutely no need to further comment on this. 


I did check as best I can, your suggestions. I find nothing awry. What I get is no creation of socket or pid file in /var/run/lirc when its ownership is lirc:lirc. The daemon indeed runs as "root". Am I mistaken that /var/run/lirc ownership was root:root in fc22 and other Linux OS as well, as well as the daemon running as root? I assume "Illegal effective uid" is because daemon is running as root. As to why my daemon is running as root, I have not a clue. How do I change that? Does the daemon not start as root to access devices, then "downgrade" to user lirc on a "normal" installation?

I have created a udev rule to create /dev/IR link, as installed television tuner cards also have IR devices. There is no local (/etc/) service file for this daemon.

$ rpm -Va lirc-core
S.5....T.  c /etc/lirc/lirc_options.conf
S.5....T.  c /etc/lirc/lircmd.conf

device          = /dev/IR
effective-user  = lirc

#ls -al /var/run/lirc
total 0
drwxr-xr-x.  2 lirc lirc   40 Feb 28 10:03 .
drwxr-xr-x. 56 root root 1540 Feb 27 17:58 ..
# systemctl start lircd
# systemctl status lircd
● lircd.service - LIRC Infrared Signal Decoder
   Loaded: loaded (/usr/lib/systemd/system/lircd.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Sun 2016-02-28 10:04:05 EST; 5s ago
  Process: 26041 ExecStart=/usr/sbin/lircd --nodaemon (code=exited, status=1/FAILURE)
 Main PID: 26041 (code=exited, status=1/FAILURE)

Feb 28 10:04:05 rumble lircd-0.9.3a[26041]: Debug: No device found: /sys/class/rc/rc0/IR
Feb 28 10:04:05 rumble lircd-0.9.3a[26041]: Debug: No device found: /sys/class/rc/rc1/IR
Feb 28 10:04:05 rumble lircd-0.9.3a[26041]: Info: Initial device: /dev/IR
Feb 28 10:04:05 rumble lircd-0.9.3a[26041]: Debug: No device found: /sys/class/rc/rc0/IR
Feb 28 10:04:05 rumble lircd-0.9.3a[26041]: Debug: No device found: /sys/class/rc/rc1/IR
Feb 28 10:04:05 rumble systemd[1]: lircd.service: Main process exited, code=exited, status=1/FAILURE
Feb 28 10:04:05 rumble systemd[1]: lircd.service: Unit entered failed state.
Feb 28 10:04:05 rumble systemd[1]: lircd.service: Failed with result 'exit-code'.
Feb 28 10:04:05 rumble lircd[26041]: lircd: can't open or create /var/run/lirc/lircd.pid
Feb 28 10:04:05 rumble lircd[26041]: lircd: Permission denied
# ls -al /dev/IR
lrwxrwxrwx. 1 root root 5 Feb 24 12:49 /dev/IR -> lirc0
# ls -al /dev/lirc0
crw-rw----. 1 root lirc 244, 0 Feb 24 12:49 /dev/lirc0

# rmdir /var/run/lirc
# dnf reinstall lirc-core
...
Reinstalled:
   lirc-core.x86_64 0.9.3a-3.fc23         

# ls -al /var/run/lirc
total 0
drwxr-xr-x.  2 lirc lirc   40 Feb 28 10:41 .
drwxr-xr-x. 56 root root 1540 Feb 28 10:41 ..
# rpm -Va lirc-core
S.5....T.  c /etc/lirc/lirc_options.conf
S.5....T.  c /etc/lirc/lircmd.conf

# chown root:root /var/run/lirc
# systemctl start lircd
# systemctl status lircd
● lircd.service - LIRC Infrared Signal Decoder
   Loaded: loaded (/usr/lib/systemd/system/lircd.service; disabled; vendor preset: disabled)
   Active: active (running) since Sun 2016-02-28 10:44:01 EST; 4s ago
 Main PID: 26847 (lircd)
   CGroup: /system.slice/lircd.service
           └─26847 /usr/sbin/lircd --nodaemon

Feb 28 10:44:01 rumble lircd-0.9.3a[26847]: Debug: No device found: /sys/class/rc/rc1/IR
Feb 28 10:44:01 rumble lircd-0.9.3a[26847]: Info: Initial device: /dev/IR
Feb 28 10:44:01 rumble lircd-0.9.3a[26847]: Debug: No device found: /sys/class/rc/rc0/IR
Feb 28 10:44:01 rumble lircd-0.9.3a[26847]: Debug: No device found: /sys/class/rc/rc1/IR
Feb 28 10:44:01 rumble lircd[26847]: lircd-0.9.3a[26847]: Illegal effective uid: lirc: Success
Feb 28 10:44:01 rumble lircd-0.9.3a[26847]: Illegal effective uid: lirc: Success
Feb 28 10:44:01 rumble lircd-0.9.3a[26847]: Info: Using remote: mceusb.
Feb 28 10:44:01 rumble lircd-0.9.3a[26847]: Notice: lircd(default) ready, using /var/run/lirc/lircd
Feb 28 10:44:01 rumble lircd[26847]: lircd-0.9.3a[26847]: Info: Using remote: mceusb.
Feb 28 10:44:01 rumble lircd[26847]: lircd-0.9.3a[26847]: Notice: lircd(default) ready, using /var/run/lirc/lircd
# ps auwx | grep lirc
root     26847  0.0  0.1  62108  5472 ?        Ss   10:44   0:00 /usr/sbin/lircd --nodaemon

# ls -al /var/run/lirc/
total 4
drwxr-xr-x.  2 root root   80 Feb 28 10:44 .
drwxr-xr-x. 56 root root 1540 Feb 28 10:41 ..
srw-rw-rw-.  1 root root    0 Feb 28 10:44 lircd
-rw-r--r--.  1 root root    6 Feb 28 10:44 lircd.pid

# grep lirc /etc/passwd
lirc:x:984:978:LIRC daemon user, runs lircd.:/var/log/lirc:/sbin/nologin

Comment 8 Dan Callaghan 2016-03-20 00:53:05 UTC
The problem is that lircd writes its pid file as root, even when it is configured to run as lirc user.

Solution is to change /usr/lib/tmpfiles.d/lirc.conf so that /var/run/lirc is created root:root instead of lirc:lirc, or just turn off pid file writing in lircd by commenting out the pidfile setting in /etc/lirc/lirc_options.conf, because there is really no reason for it (systemd tracks the pid already).

But there are a few other problems too, it seems that when lircd is running as lirc user it also can't open /dev/lirc0 (which is owned root:root) and it can't write to /sys/class/rc/rc0/protocols (which is also owned root:root). So it might be worth filing a fresh bug at this point...


Note You need to log in before you can comment on or make changes to this bug.