I''m learning Ruby, RoR, and Linux all at once so please be kind. Is it possible to stop/restart a WEBrick instance that was started as a daemon process (-d attribute)? I can''t seem to find anything online that helps me determine how. I made a change to database.yml and now need to restart it and can''t seem to figure out how. I tried ruby script/server -d again but it doesn''t much care for that (expected). Thanks! Kyle Heon kheon-Wuw85uim5zDR7s880joybQ@public.gmane.org _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
On Wed, 15 Jun 2005, Kyle Heon wrote:> I''m learning Ruby, RoR, and Linux all at once so please be kind. > > Is it possible to stop/restart a WEBrick instance that was started as a > daemon process (-d attribute)? I can''t seem to find anything online that > helps me determine how.ps auxw | grep WEBrick (if the daemon is called that). killall WEBrick (or the name it''s running under if that''s different) If WEBrick was launched as root, you''ll need to kill it as root by one of the two methods: su - killall WEBrick or... sudo killall WEBrick (if you have sudo installed, this is the preferred method) -- _Deirdre web: http://deirdre.net blog: http://deirdre.org/blog/ yarn: http://fuzzyorange.com cat''s blog: http://fuzzyorange.com/vsd/ "Memes are a hoax! Pass it on!"
On Wed, Jun 15, 2005, Kyle Heon wrote:> I''m learning Ruby, RoR, and Linux all at once so please be kind. > > Is it possible to stop/restart a WEBrick instance that was started as a > daemon process (-d attribute)? I can''t seem to find anything online that > helps me determine how.When you start up webrick (using script/server) it''ll tell you the PID of the process. For instance, when I ran it just now: bob ~/depot $ script/server => Rails application started on http://0.0.0.0:3000 [2005-06-15 17:54:40] INFO WEBrick 1.3.1 [2005-06-15 17:54:40] INFO ruby 1.8.2 (2004-12-25) [i386-linux] [2005-06-15 17:54:40] INFO WEBrick::HTTPServer#start: pid=17712 port=3000 You can pass that PID to kill to shutdown the process: kill 17712 If you don''t know the PID, the best way would be to find it by looking through the output of ps for whatever you ran: bob ~/depot $ ps auxww | grep script/server benb 17712 0.0 3.1 18988 16304 ? S 17:57 0:00 /usr/bin/ruby script/server -d benb 17716 0.0 0.1 3720 644 pts/7 R+ 17:57 0:00 grep script/server The PID is the second field. There are other ways too, but you''ll learn them eventually ;) Ben
Aha! That did the trick. Thanks a bunch. Kyle Heon kheon-Wuw85uim5zDR7s880joybQ@public.gmane.org -----Original Message----- From: Ben Bleything [mailto:ben-TGHtUsa5cOzMFIMGWPqnnw@public.gmane.org] Sent: Wednesday, June 15, 2005 8:58 PM To: kheon-Wuw85uim5zDR7s880joybQ@public.gmane.org; rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: Re: [Rails] Stopping WEBrick daemon process On Wed, Jun 15, 2005, Kyle Heon wrote:> I''m learning Ruby, RoR, and Linux all at once so please be kind. > > Is it possible to stop/restart a WEBrick instance that was started as a > daemon process (-d attribute)? I can''t seem to find anything online that > helps me determine how.When you start up webrick (using script/server) it''ll tell you the PID of the process. For instance, when I ran it just now: bob ~/depot $ script/server => Rails application started on http://0.0.0.0:3000 [2005-06-15 17:54:40] INFO WEBrick 1.3.1 [2005-06-15 17:54:40] INFO ruby 1.8.2 (2004-12-25) [i386-linux] [2005-06-15 17:54:40] INFO WEBrick::HTTPServer#start: pid=17712 port=3000 You can pass that PID to kill to shutdown the process: kill 17712 If you don''t know the PID, the best way would be to find it by looking through the output of ps for whatever you ran: bob ~/depot $ ps auxww | grep script/server benb 17712 0.0 3.1 18988 16304 ? S 17:57 0:00 /usr/bin/ruby script/server -d benb 17716 0.0 0.1 3720 644 pts/7 R+ 17:57 0:00 grep script/server The PID is the second field. There are other ways too, but you''ll learn them eventually ;) Ben