From 2d636d9278214700a9f4d0049c66e8d63c049d51 Mon Sep 17 00:00:00 2001 From: Robert Nishihara Date: Tue, 20 Jun 2017 22:58:34 -0700 Subject: [PATCH] Kill jupyter in ray stop. (#689) * Kill jupyter in ray stop. * Terminate jupyter notebook in ray stop. * Fix linting. --- python/ray/scripts/scripts.py | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) 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)