@@ -213,14 +213,18 @@ def processExited(self, reason):
213213
214214
215215def spawnT2W (father , childFDs , fds_https , fds_http ):
216+ executable = sys .executable ;
217+ cmdline = [ sys .executable , __file__ ] + sys .argv [1 :];
218+ if os .environ .has_key ('TTW_COVERAGE' ):
219+ executable = os .environ ['TTW_COVERAGE' ];
220+ cmdline = [ os .environ ['TTW_COVERAGE' ], 'run' , __file__ ] + sys .argv [1 :];
221+
216222 child_env = os .environ .copy ()
217223 child_env ['T2W_FDS_HTTPS' ] = fds_https
218224 child_env ['T2W_FDS_HTTP' ] = fds_http
219225
220226 return reactor .spawnProcess (T2WPP (father , childFDs , fds_https , fds_http ),
221- sys .executable ,
222- [sys .executable , __file__ ] + sys .argv [1 :],
223- env = child_env ,
227+ executable ,cmdline ,env = child_env ,
224228 childFDs = childFDs )
225229
226230
@@ -1312,7 +1316,7 @@ def daemon_shutdown(self):
13121316 self .quitting = True
13131317
13141318 for pid in self .subprocesses :
1315- os .kill (pid , signal .SIGINT )
1319+ os .kill (pid , signal .SIGTERM )
13161320
13171321 self .subprocesses = []
13181322
@@ -1394,7 +1398,7 @@ def SigQUIT(SIG, FRM):
13941398
13951399sys .excepthook = None
13961400
1397- set_pdeathsig (signal .SIGINT )
1401+ set_pdeathsig (signal .SIGTERM )
13981402
13991403# #########################
14001404# Security UMASK hardening
@@ -1560,8 +1564,6 @@ def nullStartedConnecting(self, connector):
15601564 os .chmod (os .path .join (config .rundir , "rpc.socket" ), 0600 )
15611565
15621566 signal .signal (signal .SIGUSR1 , SigQUIT )
1563- signal .signal (signal .SIGTERM , SigQUIT )
1564- signal .signal (signal .SIGINT , SigQUIT )
15651567
15661568 start_worker ()
15671569
0 commit comments