Temporarily prevent linux from shutting down Temporarily prevent linux from shutting down linux linux

Temporarily prevent linux from shutting down


Another get-you-started solution: During shutdown, the system runs the scripts in /etc/init.d/ (or really, a script in /etc/rc.*/, but you get the idea.) You could create a script in that directory that checks the status of your backup, and delays shuts down until the backup completes. Or better yet, it gracefully interrupts your backup.

The super-user could workaround this script (with /sbin/halt for example,) but you can not prevent the super-user for doing anything if their mind is really set into doing it.


There is molly-guard to prevent accidental shutdows, reboots etc. until all required conditions are met -- conditions can be self-defined.

As already suggested you can as well perform backup operations as part of the shutdown process. See for example this page.


If users are going to be shutting down via GNOME/KDE, just inhibit them from doing so.

http://live.gnome.org/GnomePowerManager/FAQ#head-1cf52551bcec3107d7bae8c332fd292ec2261760