You are not logged in.

#1 2015-11-25 01:55:22

mrgreen7
Member
Registered: 2014-12-21
Posts: 13

[SOLVED] Failing to create a systemd service for a simple daemon

I'm trying to create a simple service for the daemon of clipmenu. I tried

[Unit]
Description=Clip menu daemon

[Service]
ExecStart=/usr/bin/clipmenud

[Install]
WantedBy=graphical.target

While the service seems to be started successfully and clipmenud is running the daemon does not seem to work. What could be missing?

Last edited by mrgreen7 (2015-11-30 22:12:22)

Offline

#2 2015-11-25 02:06:24

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: [SOLVED] Failing to create a systemd service for a simple daemon

mrgreen7 wrote:

...the daemon does not seem to work.

What exactly doesn't work?

Offline

#3 2015-11-25 02:19:05

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,559
Website

Re: [SOLVED] Failing to create a systemd service for a simple daemon

fukawi2 wrote:

What exactly doesn't work?

The link in the original post? wink

I tried to follow it to confirm my suspicion that this is some sort of clipboard management tool ... is this correct?  If so it would likely not be able to run as a system service.  It would have to run as a user service, and even then it'd likely need the proper environment variables exported to interact with the X session running for that user.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#4 2015-11-25 02:48:52

mrgreen7
Member
Registered: 2014-12-21
Posts: 13

Re: [SOLVED] Failing to create a systemd service for a simple daemon

Sorry for the broken link. Corrected it.

Yes it is a clipboard management tool.

The daemon is supposed to track when you copy something to the clipboard and make what you copied shows up in a respective history. However when starting the daemon as I described it via systemd no entries are copied to that history when copying something to the clipboard.

Is there a standard way to start services that need to interact with the X session?

Offline

#5 2015-11-25 03:00:30

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,559
Website

Re: [SOLVED] Failing to create a systemd service for a simple daemon


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#6 2015-11-30 22:11:54

mrgreen7
Member
Registered: 2014-12-21
Posts: 13

Re: [SOLVED] Failing to create a systemd service for a simple daemon

Thank you for the reply Trilby. I tried to follow your advice and made the service start the following script:

#!/usr/bin/
. /etc/X11/xinit/xinitrc.d/50-systemd-user.sh 
clipmenud

Unfortunately the daemon still was not working as intended. After I did a little more research I found that some people advice not to use systemd to start daemons that are considered user daemons in contrast to system daemons. I thus simply moved the start of the daemon in the .xinitrc file which is working fine.

Offline

#7 2015-11-30 22:18:57

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,559
Website

Re: [SOLVED] Failing to create a systemd service for a simple daemon

That's a good solution - but you could also follow the wiki page I linked to which would be to set up a systemd user session and have the service file get the right environment variables.  The script you included above acheives neither of those two goals, so I'm not surprised it failed.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

Board footer

Powered by FluxBB