Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

When you are remoted into a server that may be an hour away, and you have to reboot it, what is the best way to reboot it?

share|improve this question
6  
Use your trusty intern. –  Bart Silverstrim May 26 '11 at 12:38

5 Answers 5

@KCotreau: Your method is no guarantee that the server won't get hung up on the shutdown. It may seem more likely that it will reboot successfully but I doubt there's any data to support that supposition. If you want to make absolutley sure that you can remotely reboot a server and recover it if it hangs, you need remotely controlled power and an IP kvm.

Personally, I reboot our servers the usual way and if one of them hangs up I deal with it... that's part of the job. I can tell you that in my 11 years in the IT field that the instances of a server hanging up on a reboot could be counted on 1 hand.

I get where you're coming from but if I spent my time worrying about something that might happen, without evidence showing that it's likely to happen, I'd never leave the house.

At any rate, you've worked out a method for yourself and it looks sound, so I say if it makes you comfortable to do it that way then carry on.

share|improve this answer
    
It has happened to me. Of course, nothing guarantees that it will reboot properly, but it takes one more possibility out of the equation. Certainly there are additional measures that you can take like you said, but this does not cost any more, and it can happen even if it has not happened to you. I would also point out that if your server hangs while logging out, and you have to use remote controlled power to shut it off, I would use that as a last alternative. I would rather Windows itself try to close the program and reboot cleanly. –  KCotreau May 26 '11 at 11:02
    
@KCotreau: Fair enough. No harm in thinking about and implementing alternative methods like you have. –  joeqwerty May 26 '11 at 11:07
    
You guys are right that there is more that can be done...no question. I work with clients that range from very small to subcontracting for large companies. In the small ones, not one has additional measures in place, so I will take what I can get. –  KCotreau May 26 '11 at 11:17
up vote 4 down vote accepted

I actually know how I do it, but I really wanted to share this tip, so I phrased it as a question. I hope that is O.K.

If you use the obvious Start>Shutdown>Reboot, you risk the server not actually rebooting. We have all seen situations where you just log off of a computer, but it waits for you to end task on some program hung in the background. If that happens, you may be going into work to fix the problem immediately if the server is important enough.

I strongly suggest that you never reboot a computer remotely using Start>Shutdown>Reboot, or to allow a program install to do it (say no to the reboot, then follow the directions below), but rather create a batch file called reboot.bat with the command “shutdown -r -f -t 00” (minus the quotes) and put it in %windir%\system32 directory. The switch -f forces those tasks closed, and you are much more likely to have a successful reboot. You then just run reboot in either Start>Run, or as I prefer, simply at a command prompt. I prefer not to leave a command in the run box that can accidentally reboot a server.

share|improve this answer
2  
The really best way to reboot it is either having a KVM extender / console redirection card connected to the server or running it as a virtual machine where you could intervene in case of shutdown or startup problems :) –  the-wabbit May 26 '11 at 10:49
    
Yes, there are things that can improve upon this, but not everyone has those things in place. This still improves the normal reboot process when you are totally relying on Windows. –  KCotreau May 26 '11 at 11:15
1  
+1. It doesn't solve every possible failure to reboot, but it's certainly a step above the standard Start->Shutdown->Reboot. –  Hyppy May 26 '11 at 11:55
    
I shutdown with the usual Start->Shutdown->Reboot method and in the rare case that it fails I just use shutdown. No need for batch files. shutdown /? will show you the /m parameter which allows you to shutdown from another machine that network access. –  railmeat May 28 '11 at 0:26
    
Thanks for the clueless downvote railmeat. I am well aware of the -m switch, but that does NOTHING if you already tried to shut it down remotely and it hangs. Usually the RPC service will be stopped and you will not be able to access it at that point with the -m switch...not that it would matter since the shutdown is already in progress, so any subsequent shutdown command is ignored. What you do usually is simply not as good. –  KCotreau May 28 '11 at 0:34

In my experience it helps if you close down most programs/services first. Especially Exchange can be a bitch to reboot, but less so if you first manually shut down the services.

share|improve this answer

First, I am going to assume you have out-of-band management (DRAC, iLO, a/iLOM, etc). A terminal server or IP KVM can be helpful but if you have a lockup when you're shutting down your boat is sunk. If you don't, you may want to look into one of the above for the future if its a possible addon. From there, simply log in, reboot, and watch what happens. If it locks up at shutdown, kill the power and let the OS come back up. This is why out of band management is important.

share|improve this answer

I have a ready made batch file which calls the shutdown command with appropriate parameters. I also have a one-time scheduled task that is normally disabled. When required I set the schedule for that task to a couple of minutes in the future, enable it and log off.

The logging off part is the key, as every time I've had a server hang during shutdown it was because I did the shutdown while logged on. Using the task scheduler method I've so far (about 6 years) had 100% success.

share|improve this answer

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.