6

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

Jason
  • 12,229
  • 20
  • 51
  • 66

3 Answers3

8

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
Meduza
  • 442
  • 2
  • 7
5

You can use pgrep ruby with kill -9:

kill -9 `pgrep ruby`
Fernando Almeida
  • 3,134
  • 3
  • 25
  • 24
4

Another way:

kill -9 `cat tmp/pids/server.pid`
Mir
  • 1,575
  • 1
  • 18
  • 31