From 27ab2e55d39cdacd07f38387091e937ffc0f9be8 Mon Sep 17 00:00:00 2001 From: Rune Kaagaard Date: Thu, 17 Jan 2013 10:13:05 +0100 Subject: [PATCH] Service mod.: Proper(?) handling of return code 69 This adds "69" to the return codes from the status command that should be considered as not running. At least "django-celery" uses this return code, maybe others:: /venv/bin/python /code/project/manage.py celeryctl status echo $? # 69 when not running. A bit of googling let me to http://tldp.org/LDP/abs/html/exitcodes.html and on a Ubuntu Server 12.10 I get:: ~# cat /usr/include/sysexits.h | grep 69 #define EX_UNAVAILABLE 69 /* service unavailable */ I'm not sure if the content of sysexits.h is the same on other OS'es. --- library/service | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/library/service b/library/service index 9eca452288..517fb7b9bc 100644 --- a/library/service +++ b/library/service @@ -313,9 +313,7 @@ class LinuxService(Service): # if the job status is still not known check it by response code if self.running == None: - if rc == 3: - self.running = False - if rc == 2: + if rc in [2, 3, 69]: self.running = False elif rc == 0: self.running = True