shutdown -h now

Big Red Button

Careful with that button …

“I am a computer, dumber than any human and smarter than my administrator.”

— Tech Support Slogan

Speaking of eating humble pie … this webserver (running several blogs and several other websites) was out of service for the past 12 hours or so. Why? Because, when I was going to sleep, I casually told my home computer to “shutdown -h now” (where -h means “halt”, i.e. don’t reboot, just turn off) … except that just before doing so, I connected to the webserver to check something … and forgot to disconnect. So I was not talking to my home computer, I was talking to the webserver. Which is located in a closet in a closed-off room in a networking facility somewhere in town that I have no access to.

Whoo-oops!

The lessons: if you log on as root to your webserver, and you want it to stay up, and you have a fallible, human mind, you’ll want to rename that shutdown command to ReallyHonestlyPleaseShutdownAndYesIDoMeanThatEarnestly.

But something good (slightly) must come of this: for the anxious, here is a Windows batch file (first I start working in Marketing and now I’m programming Windows batch files? I see pointy hair in my future) that will keep pinging a given IP address until it gets a response, and then beep. It sets the window title as “down” while it isn’t getting responses, and then as “UP” when it does, so you can just run it in a cmd window and minimize it, and the status will be in your taskbar.

pingandbeepwhenup.bat

Usage: pingandbeepwhenup <IP addr> [timeout in millisecs, default 30000]
Example: pingandbeepwhenup 213.176.151.74

4 Responses to “shutdown -h now”

  1. henrik Says:

    It also helps to have your bash prompts on servers look different from the ones at home/office and those of root users different from those of ordinary users;) Been down the same road several times before…

  2. GÞB Says:

    True! My root prompt is red and normal prompt green, but I need to be root on my own machine in order to shutdown, so that doesn’t help.

    And my prompt does look different on the two machines (it has the hostname in it) … but evidently that’s not enough when you’re sleepy and absent-minded, and shutdown feels casual on your home machine. So bigger obstacles are needed! :)

  3. Gummi Says:

    Here’s an idea: go to bed earlier.

  4. GÞB Says:

    An interesting — though slightly bizarre — idea.

    But I think the real point you made is: I shouldn’t wish for a smarter head. I need a smarter ass.

    ;-þ