Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When I hit restart, after a second or two, everything closes and the machine restarts. But sometimes, within that second I realize that I really didn't want restart just then. How can I stop the machine from restarting at that time?

The best way I can figure out is to cancel a save request if something needs saving, but that isn't always the case.

share|improve this question

5 Answers 5

up vote 4 down vote accepted

if you're really quick you could open a terminal window and type

sudo killall shutdown

that might work. Otherwise, quickly open an application that always asks if you really want to quit. You could use applescript to make such an application:

on quit
display dialog "Really shut down?" buttons {"No", "Yes"} default button "no"
 if the button returned of the result is "Yes" then
 continue quit
 end if
 -- If I don't continue the quit, the app will keep running.
end quit

type that into the applescript editor and save it as an application, then put it somewhere handy.

NB. Both of these methods may not work. I'm too lazy to find out if they do, because it might involve having to reboot several times.

share|improve this answer
    
and @JFW I like your suggestions, but it would be nice if I could have my shut down continue unhindered if I didn't do anything. At the moment, it seems that I would have to essentially confirm shutdown, which is not great (not as bad as shutting down just as my boss walks in requesting file X) –  mechko Aug 14 '10 at 17:58
1  
Well you could have the dialogue time out - add "with timeout 5" to the end of the "display dialog" line. That way you've got a 5 second window to click the "no" button. Anyway, if you just have the applescript's icon somewhere handy like the dock you can click it whenever you want to abort a shutdown, rather than run it every time. –  stib Aug 15 '10 at 12:25
    
I'll give it a shot when I get out of bootcamp. –  mechko Aug 15 '10 at 22:37

Quickly go click an icon in the dock to launch an app that wasn't running.

That's what I do if I can't use the unsaved documents trick.

share|improve this answer

Unfortunately I don't know of any shortcut-based command that stops the restarting, but there are some... Unusual ways to cancel the restart.

As you said, having an open unsaved document allows you to halt the restart.

Having a web browser with browsers open (Firefox is the best option) which would warn you and prompts if you want to save the tabs for the next browsing session has the same effect.

share|improve this answer

I always keep a random string unsaved in TextEditor, then before rebooting I'll be asked if I wanna save the document, and it gives me time to think if I really want a reboot. By hitting Cancel on the dialog, the reboot will be cancelled.

It's a dirty trick, but works well for me.

share|improve this answer

I'm assuming that 98% of linux commands are also on a mac, but on Linux you can create a shortcut that points to sudo shutdown -c works.

share|improve this answer
    
according to the man page for shutdown on osx there's no -c option –  stib Aug 14 '10 at 14:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.