Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to stop a Daemon Server in Rails?

I am running my rails application using the following

  $script/server -d webrick  

on my Ubuntu system , above command run the webrick server in background . I could kill the process using kill command

  $kill pid 

Does rails provide any command to stop the background running daemon server ?

like the one provided by rails to start the server , Thanks .

EDIT When it is appropriate to start the daemon server ? Any real time scenario will help Thanks

like image 519
Srinivas M.V. Avatar asked Jul 22 '09 09:07

Srinivas M.V.


People also ask

How do I stop a Rails server from running?

One way to shut down a rogue server is with the kill command. For the PID output above, you could kill the corresponding stuck server using kill 42612 . And if that didn't work, you could try kill -9 42612 .

How do I cancel my Puma server?

It says 'To stop, click Ctrl+c '.


1 Answers

if it can be useful, on linux you can find which process is using a port (in this case 3000) you can use:

lsof -i :3000

it'll return the pid too

like image 131
magnum Avatar answered Sep 17 '22 13:09

magnum