Expand user on PID path

This commit is contained in:
Unrud 2017-05-12 11:35:40 +02:00
parent fcccb3f7af
commit 6762fc1cad

View File

@ -120,7 +120,8 @@ def daemonize(configuration, logger):
# Check and create PID file in a race-free manner
if configuration.get("server", "pid"):
try:
pid_path = os.path.abspath(configuration.get("server", "pid"))
pid_path = os.path.abspath(os.path.expanduser(
configuration.get("server", "pid")))
pid_fd = os.open(
pid_path, os.O_CREAT | os.O_EXCL | os.O_WRONLY)
except OSError as e: