Front page

Prevent shutdown when running backup

23ffe09b9b3546b9b8f348c7f40961d2
BLOWTORCH YUCATAN TAPEWORM

From: Ben Boeckel <mathstuf@gmail.com>
Date: Fri, 3 Feb 2017 15:13:32 -0500

   On Fri, Feb 03, 2017 at 20:56:11 +0100, Jan Niggemann wrote:
   > But when when using the Gnome "power-button" (in the top right menu)  
   > and selecting "Power Off", the lock is ignored and my system, you  
   > guess it, shuts down and switches off power.
   > I believe this is by design (WTF, really?):  
   
   The D-Bus call is low-level. If GNOME isn't doing sanity checks at its
   level, that's a bug there.
   
   > Question: How do you prevent reboot, suspend or shutdown?
   > Do you simply set the inhibitor lock as another user?
   
   Hmm. I use `init 0` to shut down my machines (or the power button). This
   really sounds like a bug in GNOME for not doing that "make an override
   button" behavior.
   
   I suppose you could run the backup as `root` to make the lock
   unignorable…
   
   --Ben
   
   _______________________________________________
   obnam-support mailing list
   obnam-support@obnam.org
   http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/obnam-support-obnam.org
From: Jan Niggemann <jn@hz6.de>
Date: Fri, 03 Feb 2017 20:56:11 +0100

   Hi all,
   
   some time ago, I asked how to prevent a shutdown when a backup is in progress:
   http://distix.obnam.org/obnam-support/2cd4a5e79ad2465d8c63e14ae228c2ba.html
   
   I have a new notebook with Debian 8.7 and sytemd and tried to prevent  
   the shutdown like this:
           systemd-inhibit --what=shutdown:sleep --who=obnam \
               --why="Backup in progress" --mode=block \
               obnam backup
   
   This does not work for me: The lock is set (I verified it using  
   systemd-inhibit --list) and prevents shutting down the system from the  
   console using "sudo shutdown".
   
   But when when using the Gnome "power-button" (in the top right menu)  
   and selecting "Power Off", the lock is ignored and my system, you  
   guess it, shuts down and switches off power.
   I believe this is by design (WTF, really?):  
   https://bugs.freedesktop.org/show_bug.cgi?id=66321
   
   Question: How do you prevent reboot, suspend or shutdown?
   Do you simply set the inhibitor lock as another user?
   
   Jan