A while ago I asked for how to stop a music player while the screen is locked. The answer was to use actkbd which works like a charm. Now I wanted to add actkbd as a service to systemd in order to start it automatically when booting. So as you can see the service is started correctly and it shows up in htop as well. Some output below:
[root@hostname init.d]# systemctl start actkbd.service [root@hostname init.d]# systemctl status actkbd.service actkbd.service - Actkbd: Daemon for X-independent shortcuts Loaded: loaded (/etc/systemd/system/multi-user.target.wants/actkbd.service) Active: active (running) since Tue, 10 Apr 2012 17:50:36 +0200; 2s ago Process: 23526 ExecStart=/usr/local/sbin/actkbd -d /dev/input/event3 -D (code=exited, status=0/SUCCESS) Main PID: 23527 (actkbd) CGroup: name=systemd:/system/actkbd.service └ 23527 /usr/local/sbin/actkbd -d /dev/input/event3 -D [root@hostname init.d]# systemctl stop actkbd.service [root@hostname init.d]# ps -C actkbd PID TTY TIME CMD
I have the following
actkbd.service file in
[Unit] Description=Actkbd: Daemon for X-independent shortcuts [Service] Type=forking ExecStart=/usr/local/sbin/actkbd -d /dev/input/event3 -D ExecReload=/bin/kill -HUP $MAINPID ExecStop=/bin/kill -15 $MAINPID Restart=always User=root
So the problem is that after starting the service with systemctl nothing happens if I press my usual shortcut for pausing Rhythmbox. If I instead just execute the command
/usr/local/sbin/actkbd -d /dev/input/event3 -D via the a root terminal everything works fine. Why that?
Sorry if it's something obvious, I'm new to the systemd business but I couldn't find anything that helped me.
EDIT: This is still not working. If somebody has some time I'd appreciate it if one could try and reproduce it. If that is possible then I will file a bug report.