How to stop a Daemon Server in Rails?

前端 未结 15 648
灰色年华
灰色年华 2020-12-12 09:52

I am running my rails application using the following

  $script/server -d webrick 

on my Ubuntu system , above command run the webrick s

15条回答
  •  南笙
    南笙 (楼主)
    2020-12-12 10:20

    one-liner:  kill -INT `ps -e | grep ruby | awk '{print $1}'`
    

    ps -e lists every process on the system
    grep ruby searches that output for the ruby process
    awk passes the first argument of that output (the pid) to kill -INT.


    Try it with echo instead of kill if you just want to see the PID.

提交回复
热议问题