Browse Source

HACK HACK HACK - only send msgq to /dev/null for now.


git-svn-id: svn://bind10.isc.org/svn/bind10/branches/f2f200910@262 e5f2f494-b856-4b98-b285-d166d9295462
Shane Kerr 15 years ago
parent
commit
2fef71dd60
1 changed files with 9 additions and 4 deletions
  1. 9 4
      src/bin/bind10/bind10.py

+ 9 - 4
src/bin/bind10/bind10.py

@@ -46,20 +46,25 @@ class ProcessInfo:
     dev_null = open("/dev/null", "w")
     dev_null = open("/dev/null", "w")
 
 
     def _spawn(self):
     def _spawn(self):
+        if self.dev_null_stdout:
+            spawn_stdout = self.dev_null
+        else:
+            spawn_stdout = None
         spawn_env = self.env
         spawn_env = self.env
         spawn_env['PATH'] = os.environ['PATH']
         spawn_env['PATH'] = os.environ['PATH']
         self.process = subprocess.Popen(self.args,
         self.process = subprocess.Popen(self.args,
                                         stdin=subprocess.PIPE,
                                         stdin=subprocess.PIPE,
-                                        stdout=self.dev_null,
-                                        stderr=self.dev_null,
+                                        stdout=spawn_stdout,
+                                        stderr=spawn_stdout,
                                         close_fds=True,
                                         close_fds=True,
                                         env=spawn_env,)
                                         env=spawn_env,)
         self.pid = self.process.pid
         self.pid = self.process.pid
 
 
-    def __init__(self, name, args, env={}):
+    def __init__(self, name, args, env={}, dev_null_stdout=False):
         self.name = name 
         self.name = name 
         self.args = args
         self.args = args
         self.env = env
         self.env = env
+        self.dev_null_stdout = dev_null_stdout
         self._spawn()
         self._spawn()
 
 
     def respawn(self):
     def respawn(self):
@@ -94,7 +99,7 @@ class BoB:
                              self.c_channel_port)
                              self.c_channel_port)
         c_channel_env = { "ISC_MSGQ_PORT": str(self.c_channel_port), }
         c_channel_env = { "ISC_MSGQ_PORT": str(self.c_channel_port), }
         try:
         try:
-            c_channel = ProcessInfo("msgq", "msgq", c_channel_env)
+            c_channel = ProcessInfo("msgq", "msgq", c_channel_env, True)
         except Exception as e:
         except Exception as e:
             return "Unable to start msgq; " + str(e)
             return "Unable to start msgq; " + str(e)
         self.processes[c_channel.pid] = c_channel
         self.processes[c_channel.pid] = c_channel