better handling of keyboard interrupt on 'run'
+ add ServiceManager.get_cfg (works then also for FrappyManager)
This commit is contained in:
parent
09a6d1cbbe
commit
ac2ff53cb3
12
base.py
12
base.py
@ -165,6 +165,11 @@ class ServiceManager:
|
||||
|
||||
example for sea: return samenv name
|
||||
"""
|
||||
cfginfo = {}
|
||||
self.get_procs(self.group, cfginfo)
|
||||
result = cfginfo.get((ins, service))
|
||||
if result:
|
||||
return result
|
||||
return ''
|
||||
|
||||
def get_procs(self, groups=None, cfginfo=None):
|
||||
@ -334,7 +339,12 @@ class ServiceManager:
|
||||
sys.path.insert(0, start_dir)
|
||||
if wait:
|
||||
proc = subprocess.Popen(cmd.split(), env=env)
|
||||
proc.wait()
|
||||
for _ in range(3):
|
||||
try:
|
||||
proc.wait()
|
||||
break
|
||||
except KeyboardInterrupt:
|
||||
pass
|
||||
return
|
||||
process = subprocess.Popen(cmd.split(), env=env, start_new_session=True,
|
||||
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||
|
Loading…
x
Reference in New Issue
Block a user