• Norman Diamond (unregistered) in reply to Bananas
    Bananas:
    And it's a really super superuser who can type "!rm" into a shell that's no longer there courtesy of the first rm.
    Wrong, the shell is still there because it's still executing, and the user can type !rm into it. The link to the shell is gone but the file is still there until it gets closed.

    The rm command will fail because that file is gone. (Or if someone else is also running a long-running rm then the rm file is still there but the link to it is gone.)

  • Norman Diamond (unregistered)

    By the way, IBM invented the abbreviation[*] for Permanent Temporary Fix before Unix or MS-DOS or any of those other latecomers ever existed.

    [* For those who want to use the word acronym for abbreviations that aren't words, feel free to call PTF an acronym.]

  • Oscaroo (unregistered) in reply to Norman Diamond

    Well, at least you have this web-posting as documentation for your script :)

  • Erik (unregistered)

    This reminds me on a kludge I wrote for a occasionally used script, a dirty small Y2K fix. The script was used for a software that was already almost outdated in the end of the last millenium. But in january 2010 it was against all expectations still used, and suddenly it did not run correctly. At first, I thought the reason was, that it was written in Perl 5.005, but after a long day I found the lines I changed 10 years ago. The lines were commented too. From me:

    now we have a Y2K10 problem :-)

  • (cs) in reply to Norman Diamond
    Norman Diamond:
    Tom:
    AGray:
    sudo rm -rf /*
    Please! It is cryptic misinformation like this that gives Linux the undeserved reputation of being hard to understand and use.
    True but irrelevant. MS-DOS didn't exist yet when Unix's inventors designed rm and -rf and /*, and the syntax of IEHPROGM was even uglier.

    Look, before there was MS-DOS, Before there was Unix, Before there was MVS, we used OS-MFT, or OS-MVT. There one used 'IEFBR14', which in its original implementation the one instruction program had a bug (didn't specify the return code).

    Look, it was the 60's. If you remember it (some is still fuzzy to me) you weren't there, but we did put a man on the moon!

  • werner (unregistered) in reply to Erik
    Erik:
    This reminds me on a kludge I wrote for a occasionally used script, a dirty small Y2K fix. The script was used for a software that was already almost outdated in the end of the last millenium. But in january 2010 it was against all expectations still used, and suddenly it did not run correctly. At first, I thought the reason was, that it was written in Perl 5.005, but after a long day I found the lines I changed 10 years ago. The lines were commented too. From me: # now we have a Y2K10 problem :-)
    Wow. Just wow.
  • Norman Diamond (unregistered) in reply to herby
    herby:
    Norman Diamond:
    Tom:
    AGray:
    sudo rm -rf /*
    Please! It is cryptic misinformation like this that gives Linux the undeserved reputation of being hard to understand and use.
    True but irrelevant. MS-DOS didn't exist yet when Unix's inventors designed rm and -rf and /*, and the syntax of IEHPROGM was even uglier.
    Look, before there was MS-DOS, Before there was Unix, Before there was MVS, we used OS-MFT, or OS-MVT.
    Yes, and we used IEHPROGM.
    herby:
    There one used 'IEFBR14',
    That would only allow JCL's DD statements to do the limited amount of operations they could do. They couldn't create catalog entries (which resemble directories in modern OSes). They could rm individual files but not trees ... hmm, I don't remember if IEHPROGM could delete trees.
    herby:
    which in its original implementation the one instruction program had a bug (didn't specify the return code).
    The one instruction (BR 14) didn't have a bug, but the absence of a necessary additional instruction ahead of it was the bug. However, the program's name wasn't IEFSR00BR14 so maybe the random result was allowed under the spec.

    There were just as many bugs back in the day. Thank you for reminding me that some of them didn't get fixed, too. IEBGENER abended with 0C4 for me.

  • linepro (unregistered) in reply to AGray
    AGray:
    sudo rm -rf /*

    Boom...nuked hard drive

    Actually it stops at rm /bin/rm.

    I did that as an intern on System V release 4.

  • linepro (unregistered) in reply to linepro
    linepro:
    AGray:
    sudo rm -rf /*

    Boom...nuked hard drive

    Actually it stops at rm /bin/rm.

    I did that as an intern on System V release 4.

    Actually it was

    rm -rf .

    I didn't realise I was in /

  • jc (unregistered)

    Doing 'sudo rm -rf /*'' on a production server doesn't 'pale in comparison' with anything. It's wrong on sooo many levels.

  • jc (unregistered) in reply to linepro

    depends on the system. On linux (which is obviously the case here), when you unlink a running executable, it is still running and still present on the filesystem (but invisible in the directory tree) until its file handle is freed. THEN its 'really' removed. So rm -rf / really removes everything up until it starts doing bad things inside kernel filesystems maybe.

  • jc (unregistered) in reply to Norman Diamond

    Wrong again, even though the shell and rm are still running, they aren't present in the directory tree already so someone else can't log in after the shell is removed. Even though they physically exist on the filesystem for their open file handles, you can't access them outside that in a normal way. As far as the directory tree is concerned, they're gone already.

  • Kasper (unregistered) in reply to Polar Bear
    Polar Bear:
    They will "fix" it by having it run every ten minutes.
    Sadly you are almost certainly right about that.
  • Kasper (unregistered) in reply to Smee
    Smee:
    I did manage to (reversibly) brick a server by running
    gzip /lib/libc.so
    I did something similar. In the ftp client I typed a command which was roughly "get /lib/libc.so". I thought it would put the downloaded libc.so file into the current directory of the ftp client. When the X server instantly froze, I realized, that wasn't the case. AFAIR that was on a Red Hat Linux 7.0 system.
  • Kasper (unregistered) in reply to Dave
    Dave:
    dave@hal:~$ sudo rm -rf /* [sudo] password for dave: I am afraid I can't let you do that, dave. [/code]
    Try this:
    #!/bin/bash
    exec strace -p $$
  • Neil (unregistered) in reply to da Doctah
    da Doctah:
    Craash420:
    "I wonder why every paragraph has quotation marks."
    "Because it's meant ironically."
    "FTFY"
  • Narpas (unregistered)

    If I found that script was taking more than five minutes, I'd update the cron job to make it update at 2AM each night and rename the script "NightlyHousekeeping.bat"

    Boom. Now the whole thing looks deliberate and planned. Every programmer who comes after me will say, "Oh, this looks like it should run every night to do maintenance on the data. That seems important, so the programmer must have been competent."

  • jay (unregistered) in reply to herby
    herby:
    Look, before there was MS-DOS, Before there was Unix, Before there was MVS, we used OS-MFT, or OS-MVT. There one used 'IEFBR14', which in its original implementation the one instruction program had a bug (didn't specify the return code).

    Ah, the memories this brings back. I recall one of my co-workers saying that these new-fangled PCs were useless because when there was a problem, there was no way to get an ABEND dump.

    Hey, remember dropping a job in the hopper, waiting a couple of hours for it to make its way through the queue and run, and then having it fail on some dumb error? Remember working through dumps and disassembling the machine code byte by byte with the help of an IBM Yellow Card? Those were good times.

    I recall early on being introduced to the 20-foot-long shelf of manuals. There was one manual that listed all the error messages. Of course back in those days we didn't have messages with text that actually described the problem. There wasn't enough memory in the computer to hold that much text. Instead error messages were like, "IEH2397E", and you had to look them up in a big book. And in that book there were columns for the message code, a description of the message, and what at first seemed like a really helpful column: what to do to fix the problem. Except ... I quickly discovered that about 80% of the time, the helpful hint was exactly the same: "Correct the problem and re-run the job." Like, wow, thanks, I never would have thought of doing that.

  • JJ (unregistered) in reply to Norman Diamond
    Norman Diamond:
    By the way, IBM invented the abbreviation[*] for Permanent Temporary Fix before Unix or MS-DOS or any of those other latecomers ever existed.

    [* For those who want to use the word acronym for abbreviations that aren't words, feel free to call PTF an acronym.]

    Close, but not quite. http://en.wikipedia.org/wiki/IBM_Program_temporary_fix

    Askimet, how YOU doin'?

  • (cs) in reply to DonaldK

    I totally agree in the experience I've had. All code will be a legacy someone else has to carry on. I've also learned there are no temporary fixes or one-offs. They all seem to outlive their intention in production.

  • Norman Diamond (unregistered) in reply to JJ
    JJ:
    Norman Diamond:
    By the way, IBM invented the abbreviation[*] for Permanent Temporary Fix before Unix or MS-DOS or any of those other latecomers ever existed.

    [* For those who want to use the word acronym for abbreviations that aren't words, feel free to call PTF an acronym.]

    Close, but not quite. http://en.wikipedia.org/wiki/IBM_Program_temporary_fix

    Askimet, how YOU doin'?

    Jeez, of course it isn't always necessary for a WTF to involve irony, but surely it's allowed? I'm pretty sure Stan Kelly-Bootle wasn't the first one to state the real meaning of PTF either. Just because Wikipedia quotes IBM's official definition doesn't mean anyone believes it.

  • Norman Diamond (unregistered) in reply to jay
    jay:
    herby:
    Look, before there was MS-DOS, Before there was Unix, Before there was MVS, we used OS-MFT, or OS-MVT.
    Remember working through dumps and disassembling the machine code byte by byte with the help of an IBM Yellow Card?
    In the days of OS-MFT and OS-MVT, the card was green. But yeah, by the time I had to disassemble object code generated by IBM's malicious Cobol compiler, the card was yellow.

    (I mentioned this a week or two ago. If a numeric field was being compared to a constant string of blanks, or in a valid sign nibble so the numeric field was numeric and would not be equal to the constant string of blanks. If a numeric field was being compared to 0, don't or in a valid sign nibble so the last blank in the numeric field would cause an abend. IBM's Cobol compiler was malicious.)

  • secundum (unregistered) in reply to Silverhill
    Silverhill:
    Assuming that this is not mere trolling...
    vereor:
    Alex Papadimoulis:
    "I get about ten submissions a day. I post once a day and only on weekdays."
    Then, where the fuck are those articles?! If you get 10 each day, there should be at least one that's good. All you post lately is crap's crap.
    If you post even one comment per day, it should at least be a good one, instead of "crap's crap".

    This is a free service, kindly provided by Alex when and as he has time, which sometimes does not equal 5/week.

    Also, what counts as "good" is subjective.

    Also also, if he selects the best of the day, but that day's submissions are largely crap, then he either has to post a mediocre article (pissing off those who think they have a right to demand high quality), or he must decide not to post anything (pissing off those who think they have a right to demand exactly 5/week).

    Get a life, vereor.

    You know what, silverdick, you can lick mine from bottom to its top, asshole. I didn't ask you fucking opinion.

  • nubyi (unregistered) in reply to Jack

    what happens if the cronjob takes more than five minutes to run? won't the second call create inconsistencies?

  • nubyi (unregistered) in reply to Jack
    Jack:
    Tom:
    AGray:
    sudo rm -rf /*
    Please! It is cryptic misinformation like this that gives Linux the undeserved reputation of being hard to understand and use. The following, much simpler incantation, is just as effective:
    sudo rm -rf /
    It also avoids the processor overhead of interpreting that '*'.
    To help ensure things don't get out of sync, put it in a cron job to run every 5 minutes.

    what happens if the cronjob takes more than five minutes to run? won't the second call create inconsistencies?

    sorry about first post, wrong button.

  • (cs) in reply to secundum
    secundum:
    You know what, silverdick, you can lick mine from bottom to its top, asshole. I didn't ask you fucking opinion.
    OOO!! Mommy, he's using bad words! I think his mommy should spank him and send him to bed without supper!

    Get this, O Inconsistent One (first "vereor", now "secundum"; ya got Dissociative Identity Disorder?): you post here, in public -- you leave yourself open to responses, for good or ill. By offering your own opinion, you thereby, at least implicitly, "ask for opinions".

    <waves hands in sorcerous gestures> "Troll(er), begone!"

  • e john (unregistered) in reply to Smug Unix User
    Smug Unix User:
    Most quick fixes become long term problems.

    FTFY

  • EmperorOfCanada (unregistered)

    Never did: sudo rm -rf / Only did: sudo rm -rf /lib Which might be worse in that it leaves some hope of recovery. Technically at least the data was OK.

  • (cs) in reply to Roby McAndrew
    Roby McAndrew:
    AGray:
    sudo rm -rf /*

    Boom...nuked hard drive

    And it's a brave superuser who does "!rm"

    For sane use of history, you can always type Meta-^ (or ESC, ^) to see the expansion.

    To do this for you automatically, just put this in your .bashrc:

    shopt -s histverify
  • (cs) in reply to Smee
    Smee:
    I never got burned with
    rm -fr /
    as a new intern.

    I did manage to (reversibly) brick a server by running

    gzip /lib/libc.so

    oops

    The word "bricking" means it wasn't reversible.

  • someone (unregistered)

    does anybody else find the quotation marks around each paragraph unbelievably grating and impossible to read?

    oh yeah that's the real wtf captcha: suscipere

  • Luiz Felipe (unregistered) in reply to Ralph
    Ralph:
    Sudofed:
    And people rubbish Windows for having built-in protection for system files: after all, you might want to self-destruct the server as part of your routine maintenance chores and who is Microsoft to try and stop you?
    This comes down to a matter of principle. There are 10 (binary) types of people:

    00: My computer is smarter than me. I want it to override my decisions and do whatever it thinks is best.

    01: I am smarter than my computer. I want it to do whatever I command.

    Linux is not for L00sers and Windows is not for W01nners. Pick whatever you like. It isn't like anyone else is going to care.

    1. i am so much smart to waste my time doing decisions that a machine can do, then a machine will do it for me.
    2. i am so desperate to have social aprovation of other people that i need to show my computer tricks, that noone cares.
  • sudo for rm in production? (unregistered)

    If they have sudo configured to allow rm on a production machine, I think they should blame the admins, not the new guy or intern!

  • Frances (unregistered) in reply to Ben Jammin

    Someone will make the company a lot of money someday when they find that little program and rewrite it or delete it.

  • Matthew (unregistered)

    When quoting several paragraphs, only the last paragraph should have a quotation mark at the end. The rest only have it at the beginning. As it is currently, it looks like each paragraph is being quoted from a different person.

Leave a comment on “Confessions: Every Five Minutes”

Log In or post as a guest

Replying to comment #:

« Return to Article