burke / zeus

Boot any rails app in under a second.
MIT License
3.33k stars 231 forks source link

Stopping zeus #517

Open EleanorRagone opened 9 years ago

EleanorRagone commented 9 years ago

Is it possible to get a command to stop zeus? It's pretty annoying having to find the PIDs and manually kill it every time. Unless I'm missing something; I haven't been able to find a relevant command to stop it running.

tuxayo commented 9 years ago

killall zeus ?

EleanorRagone commented 9 years ago
$ps aux | grep zeus
pragone         64598   0.0  0.9  2663928 145936   ??  S     7:37PM   0:00.49 zeus slave: test_helper
pragone         64597   0.0  0.5  2628952  77276   ??  S     7:37PM   0:00.12 zeus slave: prerake
pragone         64173   0.0  0.8  2635232 142564   ??  S     7:37PM   0:02.57 zeus slave: test_environment
pragone         64172   0.0  0.8  2627916 138192   ??  S     7:37PM   0:02.73 zeus slave: development_environment
pragone         32043   0.0  0.8  2607264 129180   ??  S     6:01PM   0:03.05 zeus slave: default_bundle
pragone         31646   0.0  0.3  2500716  48116   ??  S     6:01PM   0:01.71 zeus slave: boot
pragone         31645   0.0  0.0  2470388   6796   ??  S     6:01PM   0:13.69 /Users/pragone/.rvm/gems/ruby-2.1.5@remoonline/gems/zeus-0.15.3/build/fsevents-wrapper
pragone         31643   0.0  0.1 145193400  14232   ??  S     6:01PM   0:01.82 /Users/pragone/.rvm/gems/ruby-2.1.5@remoonline/gems/zeus-0.15.3/build/zeus-darwin-amd64 start
pragone          7129   0.0  1.2  2697096 208508   ??  S     5:58PM   0:02.05 zeus command: test [in pry-rescue @ /Users/pragone/projects/remoonline]
pragone          7124   0.0  0.0  2658436   2752   ??  Ss    5:58PM   0:04.54 zeus runner: test

$ killall zeus
No matching processes belonging to you were found
EleanorRagone commented 9 years ago

For those interested, this is my killzeus script to handle this problem for now: $PROJECTNAME helps to only kill zeus for a particular project, rather than across the board

#!/bin/bash --login
pid=`ps aux | grep "zeus-darwin-amd64 start" | grep $PROJECTNAME | awk '{print $2}'`
if [ $pid ]; then
  echo 'Killing zeus'
  kill $pid
else
  echo 'Zeus not running'
fi
pid=`ps aux | grep "zeus slave: boot" | grep $PROJECTNAME | awk '{print $2}'`
if [ $pid ]; then
  echo 'Killing zeus'
  kill $pid
else
  echo 'Zeus not running'
fi
rm ./.zeus.sock > /dev/null 2> /dev/null
tuxayo commented 9 years ago

Indeed, not as simple as I thought.

How do you launch zeus? If it's by using zeus start then doing ctrl-c in the terminal will stop it.

EleanorRagone commented 9 years ago

I launch it into the background. I don't remember why anymore... zeus start > log/zeus.log &

Hirurg103 commented 4 years ago

Hi @EllieRagone ,

@justin808 in his Fast Tests: Comparing Zeus With Spring on Rails 4.1 and RSpec 3 article posted a code snippet with a simple zsh function that kills rails-related processes including zeus:

# Kill processes related to rails
pgk() {
  for x in spring rails phantomjs zeus; do 
    pkill -fl $x;
  done
}
capripot commented 2 years ago

Do you see a .zeus.sock file when started? If so, you can use fuser -k .zeus.sock to stop it!