diff options
Diffstat (limited to 'bitbake/bin')
-rwxr-xr-x | bitbake/bin/bitbake-worker | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/bitbake/bin/bitbake-worker b/bitbake/bin/bitbake-worker index bc13b4f314..c173dbe01d 100755 --- a/bitbake/bin/bitbake-worker +++ b/bitbake/bin/bitbake-worker | |||
@@ -242,6 +242,14 @@ class BitbakeWorker(object): | |||
242 | self.build_pids = {} | 242 | self.build_pids = {} |
243 | self.build_pipes = {} | 243 | self.build_pipes = {} |
244 | 244 | ||
245 | signal.signal(signal.SIGTERM, self.sigterm_exception) | ||
246 | |||
247 | def sigterm_exception(self, signum, stackframe): | ||
248 | bb.warn("Worker recieved SIGTERM, shutting down...") | ||
249 | self.handle_finishnow(None) | ||
250 | signal.signal(signal.SIGTERM, signal.SIG_DFL) | ||
251 | os.kill(os.getpid(), signal.SIGTERM) | ||
252 | |||
245 | def serve(self): | 253 | def serve(self): |
246 | while True: | 254 | while True: |
247 | (ready, _, _) = select.select([self.input] + [i.input for i in self.build_pipes.values()], [] , [], 1) | 255 | (ready, _, _) = select.select([self.input] + [i.input for i in self.build_pipes.values()], [] , [], 1) |