[svn] commit: r1087 - /trunk/src/bin/bind10/bind10.py.in

BIND 10 source code commits bind10-changes at lists.isc.org
Wed Mar 3 08:36:38 UTC 2010


Author: shane
Date: Wed Mar  3 08:36:38 2010
New Revision: 1087

Log:
Do not start if msgq is already running.


Modified:
    trunk/src/bin/bind10/bind10.py.in

Modified: trunk/src/bin/bind10/bind10.py.in
==============================================================================
--- trunk/src/bin/bind10/bind10.py.in (original)
+++ trunk/src/bin/bind10/bind10.py.in Wed Mar  3 08:36:38 2010
@@ -152,11 +152,22 @@
         Returns None if successful, otherwise an string describing the
         problem.
         """
+        # try to connect to the c-channel daemon, 
+        # to see if it is already running
+        c_channel_env = { "ISC_MSGQ_PORT": str(self.c_channel_port), }
+        if self.verbose:
+            sys.stdout.write("Checking for already running msgq\n")
+        # try to connect, and if we can't wait a short while
+        try:
+            self.cc_session = isc.cc.Session(self.c_channel_port)
+            return "msgq already running, cannot start"
+        except isc.cc.session.SessionError:
+            pass
+
         # start the c-channel daemon
         if self.verbose:
             sys.stdout.write("Starting msgq using port %d\n" % 
                              self.c_channel_port)
-        c_channel_env = { "ISC_MSGQ_PORT": str(self.c_channel_port), }
         try:
             c_channel = ProcessInfo("msgq", "msgq", c_channel_env, True)
         except Exception as e:




More information about the bind10-changes mailing list