From 19fd4b3ce98dd6541b38ba9a81c801ed0b1490c3 Mon Sep 17 00:00:00 2001 From: Martyn Inglis Date: Wed, 8 Feb 2017 16:58:26 +0000 Subject: [PATCH] Log which file we're trying to stop. --- scripts/stop_celery.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/stop_celery.py b/scripts/stop_celery.py index 482efad48..71b10ec03 100755 --- a/scripts/stop_celery.py +++ b/scripts/stop_celery.py @@ -38,12 +38,13 @@ def get_pid_from_file(filename): return strip_white_space(celery_pid) -def issue_term_signal_to_pid(pid): +def issue_term_signal_to_pid(pid, celery_pid_file): """ Issues a TERM signal (15) to the master celery process. This method attempts to print out any response from this subprocess call. However this call is generally silent. """ + print("Trying to stop ", celery_pid_file) result = subprocess.Popen(['kill', '-15', pid], stdout=subprocess.PIPE, stderr=subprocess.PIPE) for line in result.stdout.readlines(): print(line.rstrip()) @@ -66,7 +67,7 @@ if __name__ == "__main__": celery_pid = get_pid_from_file(celery_pid_file) - issue_term_signal_to_pid(celery_pid) + issue_term_signal_to_pid(celery_pid, celery_pid_file) """ Blocking loop to check for the still running process.