mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
start thread in try block
This commit is contained in:
parent
b878f01662
commit
72519878c0
1 changed files with 8 additions and 9 deletions
|
@ -134,16 +134,15 @@ def minion_process():
|
|||
log.error('Minion process encountered exception: %s', exc)
|
||||
os._exit(salt.defaults.exitcodes.EX_GENERIC)
|
||||
|
||||
if not salt.utils.platform.is_windows():
|
||||
thread = threading.Thread(target=suicide_when_without_parent, args=(os.getppid(),))
|
||||
thread.start()
|
||||
|
||||
minion = salt.cli.daemons.Minion()
|
||||
signal.signal(signal.SIGHUP,
|
||||
functools.partial(handle_hup,
|
||||
minion))
|
||||
|
||||
try:
|
||||
if not salt.utils.platform.is_windows():
|
||||
thread = threading.Thread(target=suicide_when_without_parent, args=(os.getppid(),))
|
||||
thread.start()
|
||||
|
||||
minion = salt.cli.daemons.Minion()
|
||||
signal.signal(signal.SIGHUP,
|
||||
functools.partial(handle_hup,
|
||||
minion))
|
||||
minion.start()
|
||||
except (SaltClientError, SaltReqTimeoutError, SaltSystemExit) as exc:
|
||||
lock.acquire(blocking=True)
|
||||
|
|
Loading…
Add table
Reference in a new issue