You are not logged in.

#1 2012-10-09 20:56:54

palmaway
Member
Registered: 2007-03-01
Posts: 63

Lircd & systemd: custom device

Before I switched to systemd, the /etc/rc.d/lirc.d daemon script would read the file /etc/conf.d/lircd.conf in order to get custom options. In particular, I used this to configure the device LIRC should listen to, and set the driver to devinput. Now that I use systemd, how can I set this options? I tried creating a custom lirc.service in /etc/systemd/system/ (see below), but it does not work. When I reenable/restart the service it gives me the following error:

Failed to issue method call: Unit lirc.service failed to load: Invalid argument. See system logs and 'systemctl status lirc.service' for details.

How can I fix this?
Thanks!

/etc/conf.d/lircd.conf:

#
# Parameters for lirc daemon
#

#LIRC_DEVICE="/dev/lirc0"
LIRC_DEVICE="/dev/input/event8"
#LIRC_DRIVER=""
LIRC_DRIVER="devinput"
LIRC_EXTRAOPTS=""
LIRC_CONFIGFILE=""

/etc/systemd/system/lirc.service:

.include /usr/lib/systemd/system/lirc.service

[Service]
EnvironmentFile=/etc/conf.d/lircd.conf
ExecStart=/usr/sbin/lircd --pidfile=/run/lirc/lircd.pid --device=${LIRC_DEVICE} --driver=${LIRC_DRIVER} ${LIRC_CONFIGFILE}

Offline

#2 2012-10-09 21:53:02

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Lircd & systemd: custom device

You service file is missing many key parts.  You should probably check out the systemd.service man page as well as the systemd.unit man page.

Offline

#3 2012-10-09 23:14:37

palmaway
Member
Registered: 2007-03-01
Posts: 63

Re: Lircd & systemd: custom device

WonderWoofy wrote:

You service file is missing many key parts.

I did not create "my" service. I just overwrote some options by creating a file in "/etc/systemd/system/", as explained on the wiki. The original service is loaded using the command .include at the beginning of the file, as you can see...

Last edited by palmaway (2012-10-09 23:15:17)

Offline

#4 2012-10-10 02:32:35

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Re: Lircd & systemd: custom device

Rather than use the include line, why not just copy the entire contents of /usr/lib/systemd/system/lirc.service?

Offline

#5 2012-10-11 00:18:25

palmaway
Member
Registered: 2007-03-01
Posts: 63

Re: Lircd & systemd: custom device

Thanks for your reply, anonymous_user.

I actually worked a little bit more on it and I was able to get it working, even though the 'lirc.service' should be fixed. I reported this bug:
https://bugs.archlinux.org/task/31890

The changes I made to the 'lirc.service' file are there too, in case anyone is interested. Anyway, now I have a complete new service file in /etc/systemd/system/lirc.service file, instead of one with the ".include" option. I wonder why that did not work...

Offline

#6 2012-10-15 17:01:13

dejavu
Member
Registered: 2008-05-26
Posts: 103

Re: Lircd & systemd: custom device

I can confirm this problem. I am using (also) a custom service file for lirc, which was listed on the wiki.
You can still find it on the wiki using an old snapshot: https://wiki.archlinux.org/index.php?ti … did=225468.

Last edited by dejavu (2012-10-15 17:01:38)

Offline

#7 2012-10-16 21:08:00

jrk
Member
From: Nämberch
Registered: 2012-10-16
Posts: 37

Re: Lircd & systemd: custom device

Hi,

this hurt me many times too..
This seems to be the explanation. So no overriding of default entries although the opposite is claimed.

Offline

#8 2012-10-18 09:16:35

dejavu
Member
Registered: 2008-05-26
Posts: 103

Re: Lircd & systemd: custom device

jrk wrote:

Hi,

this hurt me many times too..
This seems to be the explanation. So no overriding of default entries although the opposite is claimed.

I don't think that this has something to do with the lirc-utils problem.
Simply said, the lirc service file doesn't read the config file and therefore it can't work. I would like to know, why the maintainer of the lirc-utils package made such a minimalistic service file.

Offline

Board footer

Powered by FluxBB