Can’t stop WEBrick 1.3.1 with ctrl-c on Ubuntu 11.04

I’d rather comment than add an answer for this, but not enough rep.

I have the same issue and found that resuming (with fg) after typing ctrlc then pausing (with ctrlz, as offered above) does the trick.

So the recipe is:

  1. ctrlc (does nothing right away)
  2. ctrlz (pauses WEBrick, goes back to shell)
  3. fg (resumes WEBrick, immediately follow through with SIGINT)

    lampadmin@lampadmin-DX4840:/var/www/rails/agences$ r s
    => Booting WEBrick
    => Rails 3.0.5 application starting in development on http://0.0.0.0:3000
    => Call with -d to detach
    => Ctrl-C to shutdown server
    [2011-05-14 14:25:36] INFO  WEBrick 1.3.1
    [2011-05-14 14:25:36] INFO  ruby 1.9.2 (2011-02-18) [x86_64-linux]
    [2011-05-14 14:25:36] INFO  WEBrick::HTTPServer#start: pid=2585 port=3000
    

    ^C^Z (<– ctrl-c, then ctrl-z)

    [1]+  Stopped                 rails s
    lampadmin@lampadmin-DX4840:/var/www/rails/agences$ fg
    rails s
    [2011-05-14 14:25:45] INFO  going to shutdown ...
    [2011-05-14 14:25:45] INFO  WEBrick::HTTPServer#start done.
    Exiting
    

Leave a Comment

tech