Search code examples
linuxunixexitshutdownprocess-control

How to cancel shutdown on Linux?


I'm familiar with and use shutdown in Linux, and typically just do

> shutdown -h now

But is there a way to stop shutdown from happening, say if I aim to shutdown 10 minutes from now and then in 5 minutes' time I discover I really don't want to shut down?


Solution

  • 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`