You are not logged in.
Hello,
I'm trying to run a script on GNOME logout with systemd but it does not works :-/
[Unit]
Description=Sync data
[Service]
Type=oneshot
ExecStart=/usr/local/bin/login.sh
[Install]
WantedBy=exit.target
Enabled with: systemctl --user --global enable logout
But not launched at logout, any idea?
Offline
I have something similar that works.
/home/hussam/.config/systemd/user/syncdata.service
[Unit]
Description=Sync data
[Service]
Type=oneshot
ExecStart=/usr/bin/echo "hello"
ExecStop=/usr/bin/syncdata.sh
[Install]
WantedBy=default.target
enabled by systemctl --user enable syncdata.service then start the service also with --user.
Last edited by hussam (2018-06-28 20:41:34)
Offline
Does not really work, just replace syncdata.sh with /bin/sleep 60 and you will see the logout does not lock for 60 seconds
Offline
Try RemainAfterExit=yes and set TimeoutStopSec to a large amount of time.
Does syncdata.sh exit with a 0 return value on success?
Offline