mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
use os._exit instead of sys.exit when daemonizing
According to the docs [here](https://docs.python.org/3/library/os.html#os._exit) > `os._exit` should should normally only be used in the child process after a fork(). This will exit the process with status n, without calling cleanup handlers, flushing stdio buffers, etc. Fixes saltstack/salt-jenkins#1075
This commit is contained in:
parent
158c1ca575
commit
e06ce49c1b
1 changed files with 1 additions and 1 deletions
|
@ -71,7 +71,7 @@ def daemonize(redirect_out=True):
|
|||
if pid > 0:
|
||||
# exit first parent
|
||||
salt.utils.crypt.reinit_crypto()
|
||||
sys.exit(salt.defaults.exitcodes.EX_OK)
|
||||
os._exit(salt.defaults.exitcodes.EX_OK)
|
||||
except OSError as exc:
|
||||
log.error('fork #1 failed: %s (%s)', exc.errno, exc)
|
||||
sys.exit(salt.defaults.exitcodes.EX_GENERIC)
|
||||
|
|
Loading…
Add table
Reference in a new issue