summaryrefslogtreecommitdiffstats
path: root/lib/bb/server/process.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bb/server/process.py')
-rw-r--r--lib/bb/server/process.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/bb/server/process.py b/lib/bb/server/process.py
index 279934849..e9de38e70 100644
--- a/lib/bb/server/process.py
+++ b/lib/bb/server/process.py
@@ -22,6 +22,7 @@
import logging
import signal
+import sys
import time
import bb
import bb.event
@@ -29,6 +30,7 @@ from multiprocessing import Process, Event
from bb.cooker import BBCooker
logger = logging.getLogger('BitBake')
+NULL = open('/dev/null', 'r+')
class ServerCommunicator():
def __init__(self, connection):
@@ -88,6 +90,12 @@ class ProcessServer(Process):
self._idlefunctions[function] = data
def run(self):
+ """Run the server, killing off stdin/stdout/stderr"""
+ with bb.utils.redirected_fds([sys.stdin, sys.stdout, sys.stderr],
+ [NULL, NULL, NULL]):
+ return self.main()
+
+ def main(self):
# Ignore SIGINT within the server, as all SIGINT handling is done by
# the UI and communicated to us
signal.signal(signal.SIGINT, signal.SIG_IGN)