Possible to abort shutdown on Linux?
shutdown -c
is "cancel shutdown" on reasonably recent shutdown
s.
The syntax also supports shutdown -c <message>
for announcement purposes, so that's handy if other people use the machine.
You can use ps
to find the shutdown process and abort it, for example with ps|grep shutdown
.
Alternate and less eyeball-intensive versions of this:
pkill shutdown
killall shutdown
kill `cat /var/run/shutdown.pid`
If you're a second late on the draw for shutdown -c
, and already root on the console, a very fast # init 5
will cancel a shutdown after init changes runlevel.
NOTE: This answer is mostly obsolete now. init 5
isn't very useful on systemd, which, sadly, most systems now use.