How to cancel a restart in Mac OS X 10.6

4

1

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.

Ritwik Bose

Posted 2010-08-14T09:30:57.567

Reputation: 828

Answers

8

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.

stib

Posted 2010-08-14T09:30:57.567

Reputation: 3 320

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) – Ritwik Bose – 2010-08-14T17:58:17.217

1Well 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 – 2010-08-15T12:25:15.707

I'll give it a shot when I get out of bootcamp. – Ritwik Bose – 2010-08-15T22:37:23.613

4

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.

Spiff

Posted 2010-08-14T09:30:57.567

Reputation: 84 656

3

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.

Lourenzo Ferreira

Posted 2010-08-14T09:30:57.567

Reputation: 31

1

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.

JFW

Posted 2010-08-14T09:30:57.567

Reputation: 2 094

-1

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.

digitxp

Posted 2010-08-14T09:30:57.567

Reputation: 13 502

according to the man page for shutdown on osx there's no -c option – stib – 2010-08-14T14:27:33.580