How to run a daemon process only when xfce4 session is running?

Alexander Schwinn acs82 at
Mon Jan 31 16:06:41 CET 2022

Hi Chris,

If you are using systemd, you could make a daemon out of it, and start / stop it via systemctl start/stop. E.g:

Though I did not check if that as well works without sudo magic / as a user.

Another posibility could be to start it with nohup and and kill it via "killall myscript" on logout

I suppose you saw the hooks to login/logout you can place in xfce4-session-settings / applicatiom-autostart ?

Cheers and good luck with it !


Am 31. Januar 2022 15:42:54 MEZ schrieb Chris Green <cl at>:
>I have a background process that I want to run only when an xfce4 GUI
>session is running but I can't see a way to do this.
>Putting the process in the 'Session & Startup' list in Settings starts
>it OK but the background process never stops.  Thus if I log out and
>then log back in I get multiple copies of my background process
>running and that causes all sorts of issues.
>There doesn't even seem to be a logout equivalent of .xprofile where I
>could run something that kills my daemon.
>This background process is just a shell script.
>Chris Green
>Xfce mailing list
>Xfce at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Xfce mailing list