Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Since shutdowns during rsnapshot operation will lead to inconsistent/partial backups, I wonder how to delay the system shutdown while rsnapshot is active.

The task is complicated by the fact that I need a solution which is compatible with non-expert users i.e. I need to tell reliably to the user that he needs to wait until the process is finished and not to do a hard reset. Once this is the case shutdown should continue.

A possible solution could be to replace the action of the window managers (mostly KDE) shutdown/restart/hibernate buttons by a script which first checks if rsync is active and shows a message if this is the case. But I do not know if this is possible in KDE.

share|improve this question

1 Answer 1

Try making a script to enable and disable shutdown then move the executable elsewhere then in its place put a script that:

  1. Disables shutdown
  2. Runs the program
  3. Enables shutdown

See How to disable shutdown/reboot/suspend/hibernate?.

share|improve this answer
I understand that obviously /etc/polkit-1/50-local.d/disable-shutdown.pkla would disable the shutdown e.g. but which executables/scripts are called when I press the KDE shutdown button. I need to know this in order to replace it with my version. –  highsciguy Sep 24 '12 at 16:40
But if you disable it then the KDE shutdown won't work either. Then just re-enable it afterwards as I have said above. –  spudowiar Sep 24 '12 at 16:58
On my system creating /etc/polkit-1/50-local.d/disable-shutdown.pkla does actually not prevent shutdown. Probably because of this: bugs.kde.org/show_bug.cgi?id=294714 . This should exclude this method unfortunately. –  highsciguy Sep 24 '12 at 19:51
I shall go and ask Google for some help. –  spudowiar Sep 24 '12 at 19:56
Do you have a /etc/shutdown.allow ? –  spudowiar Sep 24 '12 at 20:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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