|
From: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX - 2013-04-09 11:16:56
|
I'm trying to run multiple LIRC instances (one for each device) in a
systemd service.
This is the error I'm getting:
lircd: could not assign address to socket
lircd: Permission denied
lircd.service - LIRC Daemon
Loaded: loaded (/etc/systemd/system/lircd.service; enabled)
Active: failed (Result: exit-code) since Tue 2013-04-09 11:58:16
BST; 16s ago
Process: 27249 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 (code=exited, status=1/FAILURE)
Process: 27246 ExecStartPre=/bin/ln -s /run/lirc/lircd1
/dev/lircd1 (code=exited, status=0/SUCCESS)
Process: 27242 ExecStartPre=/bin/ln -s /run/lirc/lircd /dev/lircd
(code=exited, status=0/SUCCESS)
Process: 27239 ExecStartPre=/bin/rm -f /run/lirc/lircd
/run/lirc/lircd1 (code=exited, status=0/SUCCESS)
Process: 27235 ExecStartPre=/bin/rm -f /dev/lircd /dev/lircd1
(code=exited, status=0/SUCCESS)
Process: 27231 ExecStartPre=/bin/mkdir -p /run/lirc (code=exited,
status=0/SUCCESS)
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
Either one of these two lircd commands run fine in a sudo terminal.
|
|
From: Bengt M. <no...@be...> - 2013-04-09 20:10:31
|
On 04/09/13 13:16, XXXXXXXXXXXXXXXX wrote:> I'm trying to run multiple LIRC instances (one for each device) in a > systemd service. > > This is the error I'm getting: > > lircd: could not assign address to socket > lircd: Permission denied > .... > > 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 Two processes are trying to bind to the same port. Change one "8765" to something else (8766?) or just leave out one of the --listen arguments. |
|
From: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX - 2013-04-16 18:07:45
|
> On 04/09/13 13:16, XXXXXXXXXXXXXXXX wrote: > I'm trying to run multiple > LIRC instances (one for each device) in a >> systemd service. >> >> This is the error I'm getting: >> >> lircd: could not assign address to socket >> lircd: Permission denied >> > .... >> >> 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 > > Two processes are trying to bind to the same port. > Change one "8765" to something else (8766?) or just leave out one of the > --listen arguments. > > Thanks for your message. If I understand this correctly. 8765 is the default listening port and connection port. So --listen=8765 always defaults to --listen. I tried both --listen and --listen=8765 but it still didn't work http://www.lirc.org/html/configure.html |
|
From: Bengt M. <bu...@be...> - 2013-04-16 20:58:28
|
On 04/16/13 20:07, XXXXXXXXXXXXXXXX wrote: >> On 04/09/13 13:16, XXXXXXXXXXXXXXXX wrote: >> I'm trying to run multiple >> LIRC instances (one for each device) in a >>> systemd service. ... >> >> Two processes are trying to bind to the same port. >> Change one "8765" to something else (8766?) or just leave out one of the >> --listen arguments. >> >> > > > Thanks for your message. > > If I understand this correctly. 8765 is the default listening port and > connection port. So --listen=8765 always defaults to --listen. I tried > both --listen and --listen=8765 but it still didn't work > No, you did not understand correctly. Read again, carefully. Or simply put, start the first instance with --listen=8765 and the second with --listen=8766 Greetz, Bengt |
|
From: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX - 2013-04-16 18:15:24
|
Is there some issue with "EnvironmentFile=..." in systemd service file? I'm trying to use this type of service file: [Unit] Description=LIRC Daemon After=network.target [Service] Type=forking EnvironmentFile=/etc/conf.d/lircd.conf PIDFile=/run/lirc/lircd.pid ExecStartPre=/bin/mkdir -p /run/lirc ExecStartPre=/bin/rm -f /dev/lircd /run/lirc/lircd ExecStartPre=/bin/ln -s /run/lirc/lircd /dev/lircd ExecStart=/usr/sbin/lircd -d $LIRC_DEVICE -H $LIRC_DRIVER -P /run/lirc/lircd.pid $LIRC_CONFIGFILE ExecStopPost=/bin/rm -fR /dev/lircd /run/lirc [Install] WantedBy=multi-user.target But this is what I have to do to make it work: I have to pass the arguments explicitly to /usr/sbin/lircd. ... [Service] Type=forking EnvironmentFile=/etc/conf.d/lircd.conf PIDFile=/run/lirc/lircd.pid ExecStartPre=/bin/mkdir -p /run/lirc ExecStartPre=/bin/rm -f /dev/lircd /run/lirc/lircd ExecStartPre=/bin/ln -s /run/lirc/lircd /dev/lircd ExecStart=/usr/sbin/lircd -d "/dev/lirc0" -H "devinput" -P /run/lirc/lircd.pid /etc/lirc/lircd.conf ExecStopPost=/bin/rm -fR /dev/lircd /run/lirc ... The "EnvionmentFile=/etc/conf.d/lircd.conf" contains: LIRC_DEVICE = "/dev/lirc0" LIRC_DRIVER = "devinput" LIRC_CONFIGFILE = /etc/lirc/lircd.conf |
|
From: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX - 2013-04-16 19:11:31
|
>> Is there some issue with "EnvironmentFile=..." in systemd service file? >> >> The "EnvionmentFile=/etc/conf.d/lircd.conf" contains: >> >> LIRC_DEVICE = "/dev/lirc0" >> LIRC_DRIVER = "devinput" >> LIRC_CONFIGFILE = /etc/lirc/lircd.conf >> > > Try the Environment file *without* spaces on either side of the '=' > signs. Your Env file is not actually making the variables. > > > [root@tor5 uls]# LIRC_DEVICE = "/dev/lirc0" > bash: LIRC_DEVICE: command not found > > [root@tor5 uls]# LIRC_DEVICE="/dev/lirc0" > > [root@tor5 uls]# echo $LIRC_DEVICE > /dev/lirc0 > > > Geoff > > Hi Geoff Thanks but actually there are no white-spaces in the Env-file. I retyped the above with spaces on either side of '=' but actually in my real file there are no such spaces. If I look up status: # systemctl status lircd.service I get: >> lircd: invalid argument count |