You are not logged in.

#1 2013-04-09 21:16:03

archbawks
Banned
Registered: 2013-03-17
Posts: 75

Running Multiple LIRC/[Other App] Instances in systemd Service

I'm trying to run multiple LIRC instances (one for each device) as a systemd service. This is what my service file looks like:

[Unit]
Description=LIRC Daemon
After=network.target

[Service]
Type=oneshot
EnvironmentFile=/etc/sysconfig/lirc
ExecStartPre=/bin/mkdir -p /run/lirc
ExecStartPre=/bin/rm -f /dev/lircd /dev/lircd1
ExecStartPre=/bin/rm -f /run/lirc/lircd /run/lirc/lircd1
ExecStartPre=/bin/ln -s /run/lirc/lircd /dev/lircd
ExecStartPre=/bin/ln -s /run/lirc/lircd1 /dev/lircd1
ExecStart=/usr/sbin/lircd --device=/dev/input/event12 --output=/run/lirc/lircd1 --pidfile=/run/lirc/lircd1.pid --driver=devinput --listen=8765 /etc/lirc/lircd.conf
ExecStart=/usr/sbin/lircd --device=/dev/input/event10 --output=/run/lirc/lircd --pidfile=/run/lirc/lircd.pid --driver=devinput --connect=localhost:8765 /etc/lirc/lircd.conf
ExecStopPost=/bin/rm -f /dev/lircd /dev/lircd1
ExecStopPost=/bin/rm -fR /run/lirc

[Install]
WantedBy=multi-user.target

I'm having some trouble with it as the service runs the first time but not properly. Restarting the service results in an Permissions error. I'm presuming because the socket is till running despite having manually deleted all LIRC sockets.

At the moment I'm thinking this is because service file excludes a PID assignment like:

PIDFile=/run/lirc/lircd.pid

Yet the two instances have their own PID assignments. What should I be putting or what's a better way to run two instances of LIRC as a service?

Last edited by archbawks (2013-04-13 16:58:59)

Offline

#2 2013-04-13 16:59:21

archbawks
Banned
Registered: 2013-03-17
Posts: 75

Re: Running Multiple LIRC/[Other App] Instances in systemd Service

Anyone?

Offline

Board footer

Powered by FluxBB