Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 529210 - app-misc/lirc's systemd service doesn't work
Summary: app-misc/lirc's systemd service doesn't work
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-14 05:40 UTC by Craig Andrews
Modified: 2016-04-15 19:50 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Craig Andrews gentoo-dev 2014-11-14 05:40:27 UTC
app-misc/lirc-0.9.0-r5 comes with /usr/lib64/systemd/system/lirc.service which doesn't work. When you try to start the service using "systemctl start lirc" it fails. "systemctl status lirc" shows:
รข lirc.service - Linux Infrared Remote Control
   Loaded: loaded (/usr/lib64/systemd/system/lirc.service; enabled)
   Active: failed (Result: exit-code) since Fri 2014-11-14 00:19:38 EST; 11min ago
  Process: 4011 ExecStart=/usr/sbin/lircd --nodaemon --driver=default --device=/dev/lirc0 (code=exited, status=1/FAILURE)
 Main PID: 4011 (code=exited, status=1/FAILURE)

Nov 14 00:19:38 irrational lircd[4011]: lircd: can't open or create /var/run/lirc/lircd.pid
Nov 14 00:19:38 irrational lircd[4011]: lircd: No such file or directory
Nov 14 00:19:38 irrational systemd[1]: lirc.service: main process exited, code=exited, status=1/FAILURE
Nov 14 00:19:38 irrational systemd[1]: Unit lirc.service entered failed state.
Nov 14 00:19:38 irrational systemd[1]: lirc.service failed.

The path to the pid file should be given and the PIDFile option should be set. Here's lirc.service modified that works:
[Unit]
Description=Linux Infrared Remote Control
After=network.target

[Service]
PIDFile=/run/lirc/lircd.pid
ExecStartPre=/bin/mkdir -p /run/lirc
ExecStart=/usr/sbin/lircd --nodaemon --driver=default --device=/dev/lirc0 -P /run/lirc/lircd.pid
ExecStopPost=/bin/rm -fR /run/lirc

[Install]
WantedBy=multi-user.target


Reproducible: Always
Comment 1 Craig Andrews gentoo-dev 2016-04-10 10:32:55 UTC
Instead of using 
ExecStartPre=/bin/mkdir -p /run/lirc

RuntimeDirectory=lirc should be used instead.

Here's a working, updated unit that works:
---
[Unit]
Description=Linux Infrared Remote Control
After=network.target

[Service]
RuntimeDirectory=lirc
ExecStart=/usr/sbin/lircd --nodaemon --driver=default --device=/dev/lirc0

[Install]
WantedBy=multi-user.target
---

I submitted a pull request for this change: https://github.com/gentoo/gentoo/pull/1225


Alternatively, bug 579478 could be addressed, which would be even better.
Comment 2 Patrice Clement gentoo-dev 2016-04-15 19:50:09 UTC
commit c0ed606b04e139a24a1931bb26dff5dd0dfe1753 (HEAD -> master, origin/master, origin/HEAD)
Author:     Craig Andrews <candrews@integralblue.com>
AuthorDate: Sun Apr 10 06:32:34 2016 -0400
Commit:     Patrice Clement <monsieurp@gentoo.org>
CommitDate: Fri Apr 15 19:35:17 2016 +0000

app-misc/lirc: fix systemd unit

Gentoo-Bug: https://bugs.gentoo.org/529210
Package-Manager: portage-2.2.28
Acked-By: Mike Gilbert <floppym@gentoo.org>
Closes: https://github.com/gentoo/gentoo/pull/1225

Signed-off-by: Patrice Clement <monsieurp@gentoo.org>

app-misc/lirc/files/lirc.service | 1 +
1 file changed, 1 insertion(+)