Man Deletes His Entire Company With One Line Of Bad Code

Submitted by: richanddead 1 year ago Tech
laptop-fire

It sounds like Marco Marsala is just your garden-variety coder -- the guy who handles all the code for the business he owns, a web hosting company. Everything was going great until he screwed up this basic command: "rm -rf."

From The Independent:

The problem command was "rm -rf": a basic piece of code that will delete everything it is told to. The “rm” tells the computer to remove; the r deletes everything within a given directory; and the f stands for “force”, telling the computer to ignore the usual warnings that come when deleting files.

Normally, that code would wipe out all of the specific parts of the computer that it was pointed at. But because of an error in the way it was written, the code didn’t actually specify anywhere – and so removed everything on the computer.

“I run a small hosting provider with more or less 1535 customers and I use Ansible to automate some operations to be run on all servers,” wrote Marco Marsala. “Last night I accidentally ran, on all servers, a Bash script with a rm -rf {foo}/{bar} with those variables undefined due to a bug in the code above this line.”

 
There are 11 comments:
Male 10,855
Oooh found this tidbit at the bottom of the article: [qoute]Update: Since this story was posted, Mr Marsala has claimed that his original post was a hoax and written as a marketing stunt, but that it had happened to a client of his in 2006. Contacted by The Independent, Mr Marsala said that the post was guerilla marketing for another, unnamed, company.[/quote] Cautionary tale much?
0
Reply
Male 10,855
Yeah there's a difference between source code and shell commands. Granted there are such things called shell/bash scripts where you can write lines of shell commands. Though I think nowadays on systems with many users the fact there are many users is itself a failsafe even if one does add the "sudo" prefix*. *Before you even think about suing me because you were stupid enough to run this command, this was and is common knowledge when I wrote this and I DO advise against running this command for the reasons given in the article.
0
Reply
Male 958
rm -r has been around for a LOOOOONG time. Nobody without root permissions is going to get away with this.
0
Reply
Male 1,052
How is this any kind of positive marketing telling everyone you're basically incompetent.
0
Reply
Male 6,435
@Squidbush That type of positive marketing is working for politicians in America.
0
Reply
Male 2,390
does rm get run if run is deleted during the process? also '-r' means recursive. but anywho. Yeah, I found out it was fake before I ever heard it happened. It would have been funny though.
0
Reply
Male 321
Yes, on Unix you can delete open files because it supports hardlinks and therefore reference counting. The running process is a reference to the file and sufficient to keep the contents on disk even without a filename. (Also you can rename files while using them.)
0
Reply
Male 70
This didn't happen. Just a marketing scheme. http://www.nydailynews.com/news/national/man-deleted-entire-company-hoax-article-1.2604511
0
Reply
Male 1,151
buzzkill
0
Reply
Male 1,906
i ran that once, but it was on a virtual machine
0
Reply
Male 6,435
Wow...Hope he had good copy of database backups!
0
Reply