File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed
Hologram/Network/Modem/ModemMode Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,10 @@ def __shut_down_existing_ppp_session(self):
78
78
for pid in pid_list :
79
79
self .logger .info ('Killing pid %s that currently have an active PPP session' ,
80
80
pid )
81
- psutil .Process (pid ).terminate ()
81
+ process = psutil .Process (pid )
82
+ process .terminate ()
83
+ # Wait at least 10 seconds for the process to terminate
84
+ process .wait (10 )
82
85
83
86
def __check_for_existing_ppp_sessions (self ):
84
87
Original file line number Diff line number Diff line change @@ -73,7 +73,9 @@ def run_modem_disconnect(args):
73
73
if 'pppd' in pinfo ['name' ]:
74
74
print ('Found existing PPP session on pid: %s' % pinfo ['pid' ])
75
75
print ('Killing pid %s now' % pinfo ['pid' ])
76
- psutil .Process (pinfo ['pid' ]).terminate ()
76
+ process = psutil .Process (pinfo ['pid' ])
77
+ process .terminate ()
78
+ process .wait ()
77
79
78
80
def run_modem_signal (args ):
79
81
cloud = CustomCloud (None , network = 'cellular' )
Original file line number Diff line number Diff line change @@ -40,7 +40,9 @@ def run_network_disconnect(args):
40
40
if 'pppd' in pinfo ['name' ]:
41
41
print ('Found existing PPP session on pid: %s' % pinfo ['pid' ])
42
42
print ('Killing pid %s now' % pinfo ['pid' ])
43
- psutil .Process (pinfo ['pid' ]).terminate ()
43
+ process = psutil .Process (pinfo ['pid' ])
44
+ process .terminate ()
45
+ process .wait ()
44
46
45
47
_run_handlers = {
46
48
'network_connect' : run_network_connect ,
You can’t perform that action at this time.
0 commit comments