Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(296)

Side by Side Diff: server/autoserv

Issue 6368022: Ignore SIGTTOU. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/autotest.git@master
Patch Set: clearer comment Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python -u 1 #!/usr/bin/python -u
2 # Copyright 2007-2008 Martin J. Bligh <mbligh@google.com>, Google Inc. 2 # Copyright 2007-2008 Martin J. Bligh <mbligh@google.com>, Google Inc.
3 # Released under the GPL v2 3 # Released under the GPL v2
4 4
5 """ 5 """
6 Run an control file through the server side engine 6 Run an control file through the server side engine
7 """ 7 """
8 8
9 import sys, os, re, traceback, signal, time, logging, getpass 9 import sys, os, re, traceback, signal, time, logging, getpass
10 10
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 # Implement SIGTERM handler 47 # Implement SIGTERM handler
48 def handle_sigterm(signum, frame): 48 def handle_sigterm(signum, frame):
49 if pid_file_manager: 49 if pid_file_manager:
50 pid_file_manager.close_file(1, signal.SIGTERM) 50 pid_file_manager.close_file(1, signal.SIGTERM)
51 os.killpg(os.getpgrp(), signal.SIGKILL) 51 os.killpg(os.getpgrp(), signal.SIGKILL)
52 52
53 # Set signal handler 53 # Set signal handler
54 signal.signal(signal.SIGTERM, handle_sigterm) 54 signal.signal(signal.SIGTERM, handle_sigterm)
55 55
56 # Ignore SIGTTOU's generated by output from forked children.
57 signal.signal(signal.SIGTTOU, signal.SIG_IGN)
58
56 # Server side tests that call shell scripts often depend on $USER being set 59 # Server side tests that call shell scripts often depend on $USER being set
57 # but depending on how you launch your autotest scheduler it may not be set. 60 # but depending on how you launch your autotest scheduler it may not be set.
58 os.environ['USER'] = getpass.getuser() 61 os.environ['USER'] = getpass.getuser()
59 62
60 if parser.options.machines: 63 if parser.options.machines:
61 machines = parser.options.machines.replace(',', ' ').strip().split() 64 machines = parser.options.machines.replace(',', ' ').strip().split()
62 else: 65 else:
63 machines = [] 66 machines = []
64 machines_file = parser.options.machines_file 67 machines_file = parser.options.machines_file
65 label = parser.options.label 68 label = parser.options.label
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 # an 'abort' and return 1. 232 # an 'abort' and return 1.
230 exit_code = 1 233 exit_code = 1
231 finally: 234 finally:
232 if pid_file_manager: 235 if pid_file_manager:
233 pid_file_manager.close_file(exit_code) 236 pid_file_manager.close_file(exit_code)
234 sys.exit(exit_code) 237 sys.exit(exit_code)
235 238
236 239
237 if __name__ == '__main__': 240 if __name__ == '__main__':
238 main() 241 main()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698