How to stop a Daemon Server in Rails?

前端 未结 15 607
灰色年华
灰色年华 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条回答
  •  萌比男神i
    2020-12-12 10:13

    The only proper way to kill the Ruby on Rails default server (which is WEBrick) is:

    kill -INT $(cat tmp/pids/server.pid)
    

    If you are running Mongrel, this is sufficient:

    kill $(cat tmp/pids/server.pid)
    

    Use kill -9 if your daemon hung. Remember the implications of kill -9 - if the data kept in Active Record caches weren't flushed to disk, you will lose your data. (As I recently did)

提交回复
热议问题