Ruby-on-rails – How to stop the phusion passenger spawn server from restarting

apachemacospassengerruby-on-rails

I have Phusion Passenger running my Ruby on Rails application on my local machine, but I'd like to be able to kill the process entirely and run a different (non-Apache) service on the same port. Unfortunately, when I kill the passenger spawn server and the httpd processes, the spawn-server restarts:

15:30:37 /usr/bin $ ps ax | grep passenger
64659   ??  S      0:00.00 /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.8/ext/apache2/ApplicationPoolServerExecutable 0 /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.8/bin/passenger-spawn-server  /usr/local/bin/ruby  /tmp/passenger.64642
15:34:43 /usr/bin $ sudo kill 64659
15:34:46 /usr/bin $ sudo kill 64642
15:34:52 /usr/bin $ ps ax | grep passenger
64698   ??  S      0:00.00 /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.8/ext/apache2/ApplicationPoolServerExecutable 0 /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.8/bin/passenger-spawn-server  /usr/local/bin/ruby  /tmp/passenger.64681

How do I get phusion to stay dead (without rebooting the box)?

Best Answer

In your project directory, check out your "temp/pids" folder. There you will find that phusion passenger creates file like passenger.3000.pid, if you are running it say, on port 3000.

Now to stop this serevr on port 3000(Or any other port) just run the following command.

passenger stop --pid-file tmp/pids/passenger.3000.pid
Related Topic