3 ms·
Happened to a colleague: it was the end of the day, and we were packing up to leave. He used Ubuntu on his notebook, so he typed "shutdown -h now" on his shell
by hcarvalhoalves 13y ago
Happened to a colleague: it was the end of the day, and we were packing up to leave. He used Ubuntu on his notebook, so he typed "shutdown -h now" on his shell prior to closing the lid. Seconds later he's groaning, having noticed it was a SSH session to the production server...
It wouldn't be a big deal, wasn't for the fact it was an EC2 instance, and back then halting the instance was equivalent to deleting it permanently. We then spent the night at the office recovering and testing the server. I think we left 3:00 AM that day.
Lesson #1: it's never a good idea to "shutdown -h now" on a shell. any shell.
Lesson #2: have the process to spin up a new production server fully automated and tested
- brey 13y agomolly-guard is an good way to prevent this - forces you to type in the hostname of the machine you are trying to halt / restart etc. http://manpages.ubuntu.com/manpages/trusty/man8/molly-guard.8.html http://manpages.ubuntu.com/manpages/trusty/man8/molly-guard....
- scott_karana 13y agoExcellent if you have complete and thorough control of every server you touch, but if you don't, it could be dangerous to rely on. Murphy's Law means it'll be that one dang machine that gets shut down... Personally, I'd think that training this is a lot more portable. # hostname <foo> # shutdown -h now
- jbb555 13y agoI once did a "shutdown -h now" on a remote server on a customer site with nobody there who knew anything about the server when I'd meant to do a reboot....