How do I attach back to the WEBrick server

拈花ヽ惹草 提交于 2019-12-09 12:11:44

问题


I started the server in detached mode (-d), how do I attach back to it so that I can kill the server).


回答1:


Yu can see the id of the ruby process:

ps aux | grep ruby
username       17731   0.1  1.6  3127008  67996   ??  S     2:00PM   0:01.42 /Users/username/.rvm/rubies/ruby-1.9.2-p180/bin/ruby script/rails s -d

and kill process by id:

kill -9 17731



回答2:


You can use pgrep ruby with kill -9:

kill -9 `pgrep ruby`



回答3:


Another way:

kill -9 `cat tmp/pids/server.pid`


来源:https://stackoverflow.com/questions/7386093/how-do-i-attach-back-to-the-webrick-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!