Daemonize after creation of network sockets

The original process should exit after the server is ready.
See also https://www.freedesktop.org/software/systemd/man/daemon.html#SysV%20Daemons
This commit is contained in:
Unrud 2017-05-07 21:56:07 +02:00
parent 360e88f350
commit fcccb3f7af

View File

@ -158,7 +158,6 @@ def daemonize(configuration, logger):
def serve(configuration, logger):
"""Serve radicale from configuration."""
daemonize(configuration, logger)
logger.info("Starting Radicale")
# Create collection servers
@ -234,6 +233,7 @@ def serve(configuration, logger):
else:
# Fallback to busy waiting
select_timeout = 1.0
daemonize(configuration, logger)
logger.debug("Radicale server ready")
while not shutdown_program:
try: