1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-09-15 20:36:55 +00:00
This commit is contained in:
Guillaume Ayoub 2015-12-31 12:49:41 +01:00
parent 95fe2b6824
commit e7ce00d54f
6 changed files with 53 additions and 36 deletions

View file

@ -102,11 +102,12 @@ def run():
# Check and create PID file in a race-free manner
if config.get("server", "pid"):
try:
pid_fd = os.open(config.get("server", "pid"),
os.O_CREAT | os.O_EXCL | os.O_WRONLY)
pid_fd = os.open(
config.get("server", "pid"),
os.O_CREAT | os.O_EXCL | os.O_WRONLY)
except:
raise OSError("PID file exists: %s" %
config.get("server", "pid"))
raise OSError(
"PID file exists: %s" % config.get("server", "pid"))
pid = os.fork()
if pid:
sys.exit()