Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to cancel shutdown on Linux? [closed]

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?

like image 570
David Avatar asked Feb 08 '09 20:02

David


People also ask

What command should be used to cancel a shutdown Linux?

To cancel a shutdown, use the -c (cancel) option. Although you don't get any notification that your shutdown has been canceled, your logged in users do get notified. If you don't provide a time string a shutdown will be scheduled for one minute from now.

How do I stop a shutdown command?

Enter the following command: shutdown -a . This command will cancel the scheduled shutdown for one time. You'll have to repeat this process if you want to cancel other scheduled shutdowns. Click OK (in the Run window) or ↵ Enter (in Command Prompt or PowerShell).

How do I start Linux after shutdown?

Linux system restart To reboot Linux using the command line: To reboot the Linux system from a terminal session, sign in or “su”/”sudo” to the “root” account. Then type “ sudo reboot ” to reboot the box. Wait for some time and the Linux server will reboot itself.

What is the shutdown command in Linux?

To shutdown Linux using the command line: To shutdown the Linux system open a terminal application. Then type “ sudo shutdown -n now ” to shutdown the box.


2 Answers

shutdown -c  is "cancel shutdown" on reasonably recent shutdowns.

The syntax also supports shutdown -c <message> for announcement purposes, so that's handy if other people use the machine.

like image 95
chaos Avatar answered Sep 22 '22 22:09

chaos


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` 
like image 27
skiphoppy Avatar answered Sep 23 '22 22:09

skiphoppy