I'm using cinnamon as desktop environment on my Linux Mint system.

I want to automate a backup using unison:

Unison shall be executed prior to each logout off my session. So I was looking for a solution to execute unison every time I use the shutdown button from the cinnamon menu.

However, I was not able to find a hook that allows me to intercept the shutdown.

I also read about session-cleanup-script in /etc/lightdm/lightdm.conf. However, this does not seem to apply to my system: I seem to use the MDM Display Manager. I've been looking for hooks there.

I also tried to override /usr/bin/cinnamon-session-quit, but this seems not to be called from the shutdown menu.


If you switch to LightDM as I was suggesting, then it should be simple.

Set the following parameter in the config file:

session-cleanup-script = Script to run when quitting a user session (runs as root)
  • Hm, unfortunately I cannot test if this works: I tried to switch to LigthDM, but it crashes upon Login (without having edited the aforementioned file) - I guess its a problem with my graphics driver, but that's another story... – Stephan Richter Jul 3 '18 at 11:43
  • Did you follow my instructions ? – LinuxSecurityFreak Jul 3 '18 at 11:45
  • Did you read my comment? I can't test your instructions, as ligthdm doesn't work for me. However, i followed the instructions regarding the lightdm installation. – Stephan Richter Jul 3 '18 at 11:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.