mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Merge pull request #33211 from cachedout/user_kill
Don't try to kill a parent proc if we can't
This commit is contained in:
commit
698f1eb657
@ -68,10 +68,12 @@ def minion_process(queue):
|
||||
time.sleep(5)
|
||||
try:
|
||||
# check pid alive (Unix only trick!)
|
||||
os.kill(parent_pid, 0)
|
||||
except OSError:
|
||||
if os.getuid() == 0 and not salt.utils.is_windows():
|
||||
os.kill(parent_pid, 0)
|
||||
except OSError as exc:
|
||||
# forcibly exit, regular sys.exit raises an exception-- which
|
||||
# isn't sufficient in a thread
|
||||
log.error('Minion process encountered exception: {0}'.format(exc))
|
||||
os._exit(999)
|
||||
if not salt.utils.is_windows():
|
||||
thread = threading.Thread(target=suicide_when_without_parent, args=(os.getppid(),))
|
||||
|
Loading…
Reference in New Issue
Block a user