[Zope3-checkins] SVN: zdaemon/trunk/ Fixed: the status command didn't return a non-zero exit status when

jim cvs-admin at zope.org
Tue Nov 27 22:37:21 UTC 2012


Log message for revision 128449:
  Fixed: the status command didn't return a non-zero exit status when
  the program wasn't running. This made it impossible for other
  software (e.g. Puppet) to tell if a process was running.
  
  

Changed:
  U   zdaemon/trunk/CHANGES.txt
  U   zdaemon/trunk/src/zdaemon/README.txt
  U   zdaemon/trunk/src/zdaemon/tests/tests.py
  U   zdaemon/trunk/src/zdaemon/zdctl.py

-=-
Modified: zdaemon/trunk/CHANGES.txt
===================================================================
--- zdaemon/trunk/CHANGES.txt	2012-11-27 18:10:32 UTC (rev 128448)
+++ zdaemon/trunk/CHANGES.txt	2012-11-27 22:37:20 UTC (rev 128449)
@@ -2,6 +2,13 @@
 Change log
 ==========
 
+3.0.5 (2012-11-27)
+==================
+
+- Fixed: the status command didn't return a non-zero exit status when
+  the program wasn't running. This made it impossible for other
+  software (e.g. Puppet) to tell if a process was running.
+
 3.0.4 (2012-07-30)
 ==================
 

Modified: zdaemon/trunk/src/zdaemon/README.txt
===================================================================
--- zdaemon/trunk/src/zdaemon/README.txt	2012-11-27 18:10:32 UTC (rev 128448)
+++ zdaemon/trunk/src/zdaemon/README.txt	2012-11-27 22:37:20 UTC (rev 128449)
@@ -72,6 +72,7 @@
 
     sh> ./zdaemon -p 'sleep 100' status
     daemon manager not running
+    Failed: 3
 
 Normally, we control zdaemon using a configuration file.  Let's create
 a typical configuration file::

Modified: zdaemon/trunk/src/zdaemon/tests/tests.py
===================================================================
--- zdaemon/trunk/src/zdaemon/tests/tests.py	2012-11-27 18:10:32 UTC (rev 128448)
+++ zdaemon/trunk/src/zdaemon/tests/tests.py	2012-11-27 22:37:20 UTC (rev 128449)
@@ -143,6 +143,7 @@
 
     >>> system("./zdaemon -Cconf status")
     daemon manager not running
+    Failed: 3
 
     """
 

Modified: zdaemon/trunk/src/zdaemon/zdctl.py
===================================================================
--- zdaemon/trunk/src/zdaemon/zdctl.py	2012-11-27 18:10:32 UTC (rev 128448)
+++ zdaemon/trunk/src/zdaemon/zdctl.py	2012-11-27 22:37:20 UTC (rev 128449)
@@ -420,18 +420,21 @@
         print "wait -- Wait for the daemon process to exit."
 
     def do_status(self, arg=""):
+        status = 0
         if arg not in ["", "-l"]:
             print "status argument must be absent or -l"
-            return
+            return 1
         self.get_status()
         if not self.zd_up:
             print "daemon manager not running"
+            status = 3
         elif not self.zd_pid:
             print "daemon manager running; daemon process not running"
         else:
             print "program running; pid=%d" % self.zd_pid
         if arg == "-l" and self.zd_status:
             print self.zd_status
+        return status
 
     def help_status(self):
         print "status [-l] -- Print status for the daemon process."



More information about the Zope3-Checkins mailing list