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

Alexander Schwinn acs82 at gmx.de
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:

https://unix.stackexchange.com/questions/426862/proper-way-to-run-shell-script-as-a-daemon

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 !

Alex


Am 31. Januar 2022 15:42:54 MEZ schrieb Chris Green <cl at isbd.net>:
>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 xfce.org
>https://mail.xfce.org/mailman/listinfo/xfce
>http://www.xfce.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.xfce.org/pipermail/xfce/attachments/20220131/5032e677/attachment.html>


More information about the Xfce mailing list