diff options
-rw-r--r-- | bitbake/lib/prserv/serv.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/bitbake/lib/prserv/serv.py b/bitbake/lib/prserv/serv.py index 4375d3e590..5d6520da80 100644 --- a/bitbake/lib/prserv/serv.py +++ b/bitbake/lib/prserv/serv.py | |||
@@ -15,6 +15,7 @@ import prserv | |||
15 | import prserv.db | 15 | import prserv.db |
16 | import errno | 16 | import errno |
17 | import select | 17 | import select |
18 | import multiprocessing | ||
18 | 19 | ||
19 | logger = logging.getLogger("BitBake.PRserv") | 20 | logger = logging.getLogger("BitBake.PRserv") |
20 | 21 | ||
@@ -149,6 +150,9 @@ class PRServer(SimpleXMLRPCServer): | |||
149 | # if there is data there. | 150 | # if there is data there. |
150 | self.timeout = 0.01 | 151 | self.timeout = 0.01 |
151 | 152 | ||
153 | signal.signal(signal.SIGINT, self.sigint_handler) | ||
154 | signal.signal(signal.SIGTERM, self.sigterm_handler) | ||
155 | |||
152 | bb.utils.set_process_name("PRServ") | 156 | bb.utils.set_process_name("PRServ") |
153 | 157 | ||
154 | # DB connection must be created after all forks | 158 | # DB connection must be created after all forks |
@@ -228,8 +232,6 @@ class PRServer(SimpleXMLRPCServer): | |||
228 | os._exit(0) | 232 | os._exit(0) |
229 | 233 | ||
230 | def cleanup_handles(self): | 234 | def cleanup_handles(self): |
231 | signal.signal(signal.SIGINT, self.sigint_handler) | ||
232 | signal.signal(signal.SIGTERM, self.sigterm_handler) | ||
233 | os.chdir("/") | 235 | os.chdir("/") |
234 | 236 | ||
235 | sys.stdout.flush() | 237 | sys.stdout.flush() |
@@ -283,8 +285,10 @@ class PRServSingleton(object): | |||
283 | self.port = None | 285 | self.port = None |
284 | 286 | ||
285 | def start(self): | 287 | def start(self): |
286 | self.prserv = PRServer(self.dbfile, self.logfile, self.interface, daemon=False) | 288 | self.prserv = PRServer(self.dbfile, self.logfile, self.interface) |
287 | self.prserv.start() | 289 | self.process = multiprocessing.Process(target=self.prserv.work_forever) |
290 | self.process.start() | ||
291 | |||
288 | self.host, self.port = self.prserv.getinfo() | 292 | self.host, self.port = self.prserv.getinfo() |
289 | 293 | ||
290 | def getinfo(self): | 294 | def getinfo(self): |