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

前端 未结 13 1778
终归单人心
终归单人心 2020-12-05 02:43

I\'m using RVM, Ruby 1.9.2, and Rails 3.0.7

A standard kill of the process from another terminal doesn\'t work, either, but kill -9 does, of course.

I found

相关标签:
13条回答
  • 2020-12-05 02:54

    I had the same problem when updating my Ubuntu. Impossible to quit normally webrick using Ctrl+C, had to use kill -9...

    0 讨论(0)
  • 2020-12-05 02:56

    I'm having a similar problem, have been using Ctrl+Z to pause the job, then kill -9 %1 to kill the first paused job. Roundabout way of killing it, but it works.

    See this question on Superuser for more info: https://superuser.com/questions/243460/what-to-do-when-ctrl-c-cant-kill-a-process

    0 讨论(0)
  • 2020-12-05 02:57

    If ctr+c is not working, then before going to implement the methods mentioned , just see your terminal settings. Sometimes it may happen that we change the shortcut keys of terminal as our convenience. And we assign ctr+c for copying content of terminal. In this case ctr+c wont work for stopping the server, instead it will be used as copy purpose.

    If the settings are not changed then try using another port like 4000.

    0 讨论(0)
  • 2020-12-05 02:58

    used this line to create shortcut with ccsm (compiz conig settings manager or smth like this) -> commands:

    kill -9 `pgrep -fl 'script/rails s' | awk '{print $1}'`
    

    set to (ctrl+shift+`) or anything you like

    0 讨论(0)
  • 2020-12-05 02:59

    Found some kind of solution. Run in terminal:

    stty -echoctl
    

    And then Ctrl-C will work. http://linux.m2osw.com/remove-ctrl-C-from-being-printed-in-console

    Worked just for one session. Posted better solution near.

    0 讨论(0)
  • 2020-12-05 03:02

    Ok, the issue has been resolved for me. A recent kernel update, which I applied as part of Ubuntu's standard updates, fixed the problem.

    Also, here is a good discussion of the issue, which explains that the root cause was a kernel regression introduced in 2.6.38 ( http://redmine.ruby-lang.org/issues/4777 )

    The regression was patched, and it looks like the patch recently made it into Ubuntu's updates, so if you're being affected by this issue, you should apply the latest updates.

    0 讨论(0)
提交回复
热议问题