Keep original exception when PID file creation fails
This commit is contained in:
parent
79bcedd4bc
commit
65c53df5b3
@ -123,9 +123,9 @@ def daemonize(configuration, logger):
|
|||||||
pid_fd = os.open(
|
pid_fd = os.open(
|
||||||
configuration.get("server", "pid"),
|
configuration.get("server", "pid"),
|
||||||
os.O_CREAT | os.O_EXCL | os.O_WRONLY)
|
os.O_CREAT | os.O_EXCL | os.O_WRONLY)
|
||||||
except:
|
except OSError as e:
|
||||||
raise OSError(
|
raise OSError("PID file exists: %s" %
|
||||||
"PID file exists: %s" % configuration.get("server", "pid"))
|
configuration.get("server", "pid")) from e
|
||||||
pid = os.fork()
|
pid = os.fork()
|
||||||
if pid:
|
if pid:
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
Loading…
Reference in New Issue
Block a user