systemd-inhibit doesnt work with cinnamon gui shutdown button

Forum rules
Before you post please read how to get help
wullewu
Level 1
Level 1
Posts: 3
Joined: Fri Aug 25, 2017 6:34 am

systemd-inhibit doesnt work with cinnamon gui shutdown button

Postby wullewu » Mon Aug 28, 2017 3:58 am

Hi,
I have a backup-script for my Linux Mint machine. I wanted to block shutdown, sleep or logout commands until the script is running.

systemd-inhibit --what=shutdown:sleep:idle:handle-power-key:handle-suspend-key:handle-hibernate-key:handle-lid-switch tar -czf /media/fabian/hdd_extern/backup_fabian/home_$datum.tar.gz /home/fabian/*

So far so good. It works when i try to shutdown the machine via commandline, but when I press the shutdown button in the cinnamon gui the user logs off an the process gets terminated.

Has anyone an idea how to fix this? Thanks for your answers :-)

Return to “Scripts & Bash”