5

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.

Jeff Schaller
  • 66,199
  • 35
  • 114
  • 250

1 Answers1

1

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

Set the following parameter in the config file:

/etc/lightdm/lightdm.conf
session-cleanup-script = Script to run when quitting a user session (runs as root)
Vlastimil Burián
  • 27,586
  • 56
  • 179
  • 309
  • 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 03 '18 at 11:43
  • Did you follow my [instructions](https://unix.stackexchange.com/a/408673/126755) ? – Vlastimil Burián Jul 03 '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 03 '18 at 11:50