Dec 5, 2007

molly-guard

I was just about to shutdown a server running Ubuntu 7.10 when I discovered the following message:
root@hal:~# shutdown -h now
W: molly-guard: SSH session detected!
Please type in hostname of the machine to shutdown: hal

Broadcast message from tbendler@hal
(/dev/pts/0) at 20:30 ...

The system is going down for halt NOW!
root@hal:~#
What is molly-guard? A check in the local repository gives the answer:
protects remote machines from accidental shutdowns/reboots
The package installs a shell script that overrides the existing
shutdown/reboot/halt/poweroff commands. If any of the three commands are
called interactively over an SSH session, the shell script prompts you to
enter the name of the host you wish to shut down. This should adequately
prevent you from accidental shutdowns and reboots.

This shell script passes through the commands to the respective binaries in
/sbin and should thus not get in the way if called non-interactively, or
locally.
A nice explanation about the name molly-guard could be found in the wiktionary:
Noun

molly-guard

1. /mol'ee-gard/ A shield to prevent tripping of a computer's Big Red Switch (BRS) (emergency shutdown or power switch) by clumsy or ignorant hands.

Usage notes

Originally used of the plexiglass covers improvised for the BRS on an IBM 4341 mainframe after a programmer's toddler daughter (named Molly) tripped it twice in one day. Later generalised to covers over stop/reset switches on disk drives and networking equipment.

It's every time great fun with the kids.

No comments: