You are not logged in.

#1 2013-04-22 07:17:46

dafrizz
Member
Registered: 2011-05-27
Posts: 21

[Solved] irexec: could not connect to socket

I am trying to start irexec via .xinitrc which has worked fine for me pre-systemd, but now I am getting the following error:

irexec: could not connect to socket
irexec: no such file or directory

Lirc is running fine, remote works in mythtv.

Here's my .xinitrc

cat ~/.xinitrc
#!/bin/sh
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)

# exec gnome-session
# exec startkde
# exec startxfce4
# ...or the Window Manager of your choice
#exec xterm

#start irexec
irexec &

#exec /usr/bin/xbmc &

#turn off screensaver
xset s off -dpms

#start xfce4
exec startxfce4

and my lirc

 cat /usr/lib/systemd/system/lirc.service
[Unit]
Description=Linux Infrared Remote Control

[Service]
ExecStartPre=/usr/bin/ln -sf /run/lirc/lircd /dev/lircd
ExecStart=/usr/sbin/lircd --pidfile=/run/lirc/lircd.pid
Type=forking
PIDFile=/run/lirc/lircd.pid

[Install]
WantedBy=multi-user.target

and my /etc/conf.d/lircd.conf

cat /etc/conf.d/lircd.conf
#
# Parameters for lirc daemon
#

LIRC_DEVICE="/dev/lirc0"
LIRC_DRIVER=""
LIRC_EXTRAOPTS=""
LIRC_CONFIGFILE=""

I tried starting irexec via systemd, too, but that did not work either:

 sudo systemctl status irexec.service
irexec.service - IR Exec
   Loaded: loaded (/usr/lib/systemd/system/irexec.service; enabled)
   Active: inactive (dead) since Sun 2013-04-21 20:17:11 CST; 1s ago
  Process: 459 ExecStart=/usr/bin/irexec --daemon (code=exited, status=0/SUCCESS)

Apr 21 20:17:11 frontend systemd[1]: Starting IR Exec...
Apr 21 20:17:11 frontend systemd[1]: Started IR Exec.

cat /usr/lib/systemd/system/irexec.service

[Unit]
Description=IR Exec
After=lirc.service
Wants=lirc.service

[Service]
ExecStart=/usr/bin/irexec --daemon
Type=forking

[Install]
WantedBy=multi-user.target

Any help or pointers will be much appreciated.

Last edited by dafrizz (2013-06-08 23:58:25)

Offline

#2 2013-05-23 01:59:26

fphillips
Member
From: Austin, TX
Registered: 2009-01-24
Posts: 201

Re: [Solved] irexec: could not connect to socket

Irexec uses .lircrc and looks for it in the $HOME of the user it runs under. If you use /home/mythtv/.lircrc then you need to run irexec as mythtv.

cp {/usr/lib/,/etc/}systemd/system/irexec.service and edit so it will be persistent over upgrades and you can use systemd-delta to find modifications:

[OVERRIDDEN] /etc/systemd/system/irexec.service → /usr/lib/systemd/system/irexec.service

--- /usr/lib/systemd/system/irexec.service      2013-05-08 05:42:13.000000000 -0500
+++ /etc/systemd/system/irexec.service  2013-05-17 02:06:35.507076858 -0500
@@ -4,6 +4,7 @@
 Wants=lirc.service
 
 [Service]
+User=mythtv
 ExecStart=/usr/bin/irexec --daemon
 Type=forking

Don't forget to remove it from starting with .xinitrc.

Offline

#3 2013-06-08 00:15:21

dafrizz
Member
Registered: 2011-05-27
Posts: 21

Re: [Solved] irexec: could not connect to socket

I still can't start irexec via systemd

I edited my irexec.service file to add my normal user:

cat /usr/lib/systemd/system/irexec.service
[Unit]
Description=IR Exec
After=lirc.service
Wants=lirc.service

[Service]
User=laffi
ExecStart=/usr/bin/irexec --daemon
Type=forking

[Install]
WantedBy=multi-user.target

But when I start the service and check it's status I get the following:

sudo systemctl status irexec
irexec.service - IR Exec
   Loaded: loaded (/etc/systemd/system/irexec.service; enabled)
   Active: inactive (dead) since Fri 2013-06-07 20:06:38 CST; 16s ago
  Process: 352 ExecStart=/usr/bin/irexec (code=exited, status=0/SUCCESS)

Jun 07 20:06:38 frontend systemd[1]: Starting IR Exec...
Jun 07 20:06:38 frontend irexec[352]: irexec: could not open config files /.lircrc and /etc/lirc/lircrc
Jun 07 20:06:38 frontend irexec[352]: irexec: No such file or directory
Jun 07 20:06:38 frontend systemd[1]: Started IR Exec.

I do have a ~/.lircrc file (not a /.lircrc, not sure what that's supposed to be), but no /etc/lirc/lircrc (not sure what's supposed to go in there)

Offline

#4 2013-06-08 02:08:02

fphillips
Member
From: Austin, TX
Registered: 2009-01-24
Posts: 201

Re: [Solved] irexec: could not connect to socket

You edited the file under /usr/lib/ instead of the one under /etc. It uses the latter when present and it can't find the config file, so it's looking in other directories.

Offline

#5 2013-06-08 06:49:27

dafrizz
Member
Registered: 2011-05-27
Posts: 21

Re: [Solved] irexec: could not connect to socket

Thanks for your help so far. I thought it was the other way around, my mistake,

Still no luck, now I get the following:

sudo systemctl start irexec
Job for irexec.service failed. See 'systemctl status irexec.service' and 'journalctl -xn' for details.
sudo systemctl status irexec
irexec.service - IR Exec
   Loaded: loaded (/etc/systemd/system/irexec.service; enabled)
   Active: failed (Result: timeout) since Sat 2013-06-08 16:16:17 CST; 10s ago
  Process: 11748 ExecStart=/usr/bin/irexec (code=killed, signal=TERM)

Jun 08 16:14:47 frontend systemd[1]: Starting IR Exec...
Jun 08 16:16:17 frontend systemd[1]: irexec.service operation timed out. Terminating.
Jun 08 16:16:17 frontend systemd[1]: Failed to start IR Exec.
Jun 08 16:16:17 frontend systemd[1]: Unit irexec.service entered failed state.
sudo journalctl -xn
-- Logs begin at Sat 2013-04-20 18:36:51 CST, end at Sat 2013-06-08 16:16:44 CST. --
Jun 08 16:15:41 frontend sudo[11759]: pam_unix(sudo:session): session closed for user root
Jun 08 16:16:17 frontend systemd[1]: irexec.service operation timed out. Terminating.
Jun 08 16:16:17 frontend systemd[1]: Failed to start IR Exec.
-- Subject: Unit irexec.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Documentation: http://www.freedesktop.org/wiki/Software/systemd/catalog/be02cf6855d2428ba40df7e9d022f03d
-- 
-- Unit irexec.service has failed.
-- 
-- The result is failed.
Jun 08 16:16:17 frontend systemd[1]: Unit irexec.service entered failed state.
Jun 08 16:16:17 frontend sudo[11745]: pam_unix(sudo:session): session closed for user root

Offline

#6 2013-06-08 21:18:27

fphillips
Member
From: Austin, TX
Registered: 2009-01-24
Posts: 201

Re: [Solved] irexec: could not connect to socket

Please post the /etc/systemd/system/irexec.service it looks like you lost the --daemon parameter and it times out waiting for the process to fork.

Offline

#7 2013-06-08 23:57:29

dafrizz
Member
Registered: 2011-05-27
Posts: 21

Re: [Solved] irexec: could not connect to socket

Thanks a lot, you were spot on.

I feel like an idiot, should have noticed that myself.

Seems to be working fine now.

Offline

Board footer

Powered by FluxBB