diff --git a/python/ray/scripts/scripts.py b/python/ray/scripts/scripts.py index bc21e7c32..26f279d9c 100644 --- a/python/ray/scripts/scripts.py +++ b/python/ray/scripts/scripts.py @@ -159,19 +159,24 @@ def stop(): "local_scheduler"], shell=True) # Find the PID of the monitor process and kill it. - subprocess.call(["kill $(ps aux | grep monitor.py | awk '{ print $2 }') " - "2> /dev/null"], shell=True) - - # Find the PID of the Redis process and kill it. - subprocess.call(["kill $(ps aux | grep redis-server | awk '{ print $2 }') " - "2> /dev/null"], shell=True) - - # Find the PIDs of the worker processes and kill them. - subprocess.call(["kill $(ps aux | grep default_worker.py | " + subprocess.call(["kill $(ps aux | grep monitor.py | grep -v grep | " "awk '{ print $2 }') 2> /dev/null"], shell=True) + # Find the PID of the Redis process and kill it. + subprocess.call(["kill $(ps aux | grep redis-server | grep -v grep | " + "awk '{ print $2 }') 2> /dev/null"], shell=True) + + # Find the PIDs of the worker processes and kill them. + subprocess.call(["kill -9 $(ps aux | grep default_worker.py | " + "grep -v grep | awk '{ print $2 }') 2> /dev/null"], + shell=True) + # Find the PID of the Ray log monitor process and kill it. - subprocess.call(["kill $(ps aux | grep log_monitor.py | " + subprocess.call(["kill $(ps aux | grep log_monitor.py | grep -v grep | " + "awk '{ print $2 }') 2> /dev/null"], shell=True) + + # Find the PID of the jupyter process and kill it. + subprocess.call(["kill $(ps aux | grep jupyter | grep -v grep | " "awk '{ print $2 }') 2> /dev/null"], shell=True)