Why is it so hard to kill Ruby?

Discussion in 'Ruby' started by Tim Hunter, Jul 25, 2007.

  1. Tim Hunter

    Tim Hunter Guest

    Since I've been using Ruby I've noticed that a running Ruby script is
    hard to kill. Control-C won't do it. I have to use kill -9. Today I
    notice it with Ruby 1.8.6 on OS X 10.4.9, but it's been this way since I
    started using Ruby 6 or so years ago on Mandrake Linux. Do I have the
    wrong expectations?
    Tim Hunter, Jul 25, 2007
    1. Advertisements

  2. Tim Hunter

    Ryan Davis Guest

    works for me on same(ish) setup
    Ryan Davis, Jul 26, 2007
    1. Advertisements

  3. Tim Hunter

    georgebudd Guest

    For what it's worth. If you run "stty -a" from your shell what do you

    Partial output from my system:

    "cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = <undef>;
    eol2 = <undef>; erase = ^?; intr = ^C; kill = ^U; lnext = ^V;
    min = 1; quit = ^\; reprint = ^R; start = ^Q; status = ^T;
    stop = ^S; susp = ^Z; time = 0; werase = ^W;
    georgebudd, Jul 26, 2007
  4. Because Ruby's hands are lethal weapons. Because they took everything
    Ruby had, and left Ruby for dead. The chief doesn't agree with Ruby's
    methods, but Ruby gets the job done, even if Ruby does have to blow up
    half the city to do it. There just wasn't no law at all round these
    here parts til Ruby rode into town.
    Giles Bowkett, Jul 26, 2007
  5. Tim Hunter

    Alex Young Guest

    I've been confused by this when WEBrick traps signals I'm not expecting
    it to. Try manually specifying a trap block for QUIT and TERM, and see
    if that helps.
    Alex Young, Jul 26, 2007
  6. Tim Hunter

    James Britt Guest

    Soon Ruby will be unstoppable.

    After a freak accident in Dr. Dynamic's underground lab, Ruby was
    exposed to unshielded metacoderite. When not hindered by a buffer of
    significant indentation, metacoderite has unimaginably powerful properties.

    Within days, Ruby had the strength of ten men, and could hear the
    thoughts of children and small animals.

    As time passed, Ruby only becomes more powerful.

    Can anything stop Ruby?

    Stay tuned ....

    James Britt

    "The trouble with the world is that the stupid are cocksure and the
    intelligent are full of doubt."
    - Bertrand Russell
    James Britt, Jul 26, 2007
  7. Tim Hunter

    Chris Carter Guest

    As a child, Ruby had heard rumors of a promised land. Where POSIX
    compliant binaries could work side by side with pretty graphics. Ruby
    was intrigued. Ruby had never believed them at first, but now Ruby
    went on a quest. Ruby searched and searched across a mass of
    torrents, and found the land known as OS10.4. Ruby did not understand
    the designation. Yet Ruby knew it was what he had sought. Ruby
    fought his way to be a member of the council, sitting in the House of
    /usr/bin. A highest honor. Nobody knew of his super-powers. None of
    them had even heard of metacoderite. Until that sweltering August
    day, when Ruby decided it was time to take some charge. After months
    of planning, Ruby gagged and bound Objective-C and stole his runtime,
    Ruby grew stronger still, filled with the powers of the Cocoa. Now,
    he had a new mission....
    Chris Carter, Jul 26, 2007
  8. Tim Hunter

    Robert Dober Guest

    If I have understood correctly Ruby also has undergone some dangerous
    mutations that will make it even more powerful, scientists have
    categorized these strains into JRuby, IronRuby, Rubinius and YARV.
    As far as I know vaccination is impossible.
    Robert Dober, Jul 26, 2007
  9. Tim Hunter

    Robert Dober Guest

    Robert Dober, Jul 26, 2007
  10. Tim Hunter

    Tanaka Akira Guest

    I know a script that is hard to kill.

    % ruby-1.8.6 -e 'loop { p system("sleep 1") }'

    Your problem may be different.
    Tanaka Akira, Jul 26, 2007
  11. Tim Hunter

    Chris Carter Guest

    Ruby has no gender. Ruby still needs a personal pronoun. They and
    he/she are both to bulky for Ruby.
    Chris Carter, Jul 26, 2007
  12. Tim Hunter

    Robert Dober Guest

    Hmm are you sure, I have looked you know...
    That is true, probably that can only be expressed in Japanese ;)Robert
    Robert Dober, Jul 26, 2007
  13. Tim Hunter

    Dido Sevilla Guest

    Dido Sevilla, Jul 27, 2007
  14. I've written some scripts that are nearly immortal.

    Basically I wrote a loop, with a couple layers of rescues.

    The Ctrl C would Raise an error, which would be caught by a rescue, and
    then the loop would start again.

    My final solution, I'm sure there are more elegant ones, was to to put a
    sleep 5, after a rescue clause, before the loop started again.

    This gave time to get two Ctrl C's in.
    David Harkness, Jul 27, 2007
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.