Stories
Slash Boxes
Comments

SoylentNews is people

SoylentNews is powered by your submissions, so send in your scoop. Only 16 submissions in the queue.
posted by cmn32480 on Friday April 15 2016, @09:53PM   Printer-friendly
from the glad-it-wasn't-me dept.

A man appears to have deleted his entire company with one mistaken piece of code.

By accidentally telling his computer to delete everything in his servers, hosting provider Marco Marsala has seemingly removed all trace of his company and the websites that he looks after for his customers.

Mr Marsala wrote on a forum for server experts called Server Fault that he was now stuck after having accidentally run destructive code on his own computers. But far from advising them how to fix it, most experts informed him that he had just accidentally deleted the data of his company and its clients, and in so doing had probably destroyed his entire company with just one line of code.

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.

His backups were also mounted at the time. That's a nightmare scenario, right there.


Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 5, Informative) by Anonymous Coward on Friday April 15 2016, @10:12PM

    by Anonymous Coward on Friday April 15 2016, @10:12PM (#332457)

    There are too many clues this is a troll. The first is that a person on that level knows enough to write the scripts and run the VPSes for thousands of customers so far without incident, so probably not an intro level person. Second is that he had backups mounted while making system changes. Third is that in response to instructions to make a copy of the disks with dd, his response is that he swapped if and of (which wouldn't actually do any damage in this case). Fourth is that his given script, it wouldn't actually result in deleting everything like he said due to --preserve-root being the default now. Fifth is that he seemed to have trouble with other commands, screwing them up just enough to look like an accident but not enough for outright suspicion.

    And finally, he states in a later comment that he recovered everything (without specifying how), so this isn't news anyway.

    Starting Score:    0  points
    Moderation   +5  
       Insightful=1, Interesting=1, Informative=3, Total=5
    Extra 'Informative' Modifier   0  

    Total Score:   5  
  • (Score: 2, Informative) by Blightbow on Friday April 15 2016, @11:08PM

    by Blightbow (6203) on Friday April 15 2016, @11:08PM (#332487)

    It was in fact a troll.

  • (Score: 2) by Pino P on Friday April 15 2016, @11:17PM

    by Pino P (4721) on Friday April 15 2016, @11:17PM (#332493) Journal

    it wouldn't actually result in deleting everything like he said due to --preserve-root being the default now.

    Even on non-GNU implementations of rm, such as those in BusyBox and FreeBSD? One of my Twitter followers thinks --preserve-root is not the answer [twitter.com] as much as set -u [davidpashley.com]. POSIX sh supports a strict mode enabled by set -u, which protects programs other than rm from unintended behavior due to uninitialized variables. It's the shell equivalent of the warning-to-exception snippet in the PHP manual [php.net].

    • (Score: 0) by Anonymous Coward on Friday April 15 2016, @11:50PM

      by Anonymous Coward on Friday April 15 2016, @11:50PM (#332514)

      I think all shell scripts should start with "set -ueo pipefail" for protection from all sorts of errors and sysadmins should consider having that be the default in general.

      While true that I assumed he was using Linux and specifically GNU userland on Linux, I think that is a fair assumption given the relative market share in the server space.

      • (Score: 0) by Anonymous Coward on Friday April 15 2016, @11:57PM

        by Anonymous Coward on Friday April 15 2016, @11:57PM (#332515)

        I think all shell scripts should start with "set -ueo pipefail"

        I think all shell scripts should start with: sudo make me a sandwich -now -please

      • (Score: 2) by darkfeline on Saturday April 16 2016, @02:42AM

        by darkfeline (1030) on Saturday April 16 2016, @02:42AM (#332566) Homepage

        I think that shell scripts that would need to start with "set -ueo pipefail" should be considered for rewriting in a "real" scripting language, like Perl, Python, or Ruby, or perhaps even a language like Go, which provides static type checking, goroutines, and channels (which are superb for running different commands piped to different other commands asynchronously).

        --
        Join the SDF Public Access UNIX System today!
    • (Score: 1) by Francis on Saturday April 16 2016, @12:45AM

      by Francis (5544) on Saturday April 16 2016, @12:45AM (#332523)

      I don't see any reference to that sort of protection on my FreeBSD install, I'm using ZFS, so I could relatively easily unmount and disconnect the non-ZFS volumes and take one last snapshot before executing the command, but I'm too lazy to purposefully nuke my system knowing that rm -rf works the way that it's designed to work.

      One of the reasons why I'm on FreeBSD is because it trusts me to know what the fuck I'm doing. The Linux "fix" at best keeps you from deleting the whole system, it doesn't protect you against executing that command from inside of /home where most or all of the files that you're likely to care about are located.

  • (Score: 3, Informative) by frojack on Saturday April 16 2016, @07:19AM

    by frojack (1554) on Saturday April 16 2016, @07:19AM (#332642) Journal
    --
    No, you are mistaken. I've always had this sig.
  • (Score: 2) by turgid on Saturday April 16 2016, @09:19AM

    by turgid (4318) Subscriber Badge on Saturday April 16 2016, @09:19AM (#332676) Journal

    And look at the syntax of his rm command. No $ on the {foo} or {bar}.