From 30387c9ed5e02205a637f34fa9fc0a7fdcb3f98c Mon Sep 17 00:00:00 2001 From: Ian Carpenter Date: Mon, 18 Feb 2019 20:14:04 -0500 Subject: [PATCH] Only write the pid file when --no-pid isn't passed (#633) Prevents --no-pid from breaking --- launcher.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/launcher.py b/launcher.py index 0703f81..f7e589b 100644 --- a/launcher.py +++ b/launcher.py @@ -120,9 +120,10 @@ def _main(): elif os.name == 'posix': sys.stdout.write("\x1b]2;PyLink %s\x07" % __version__) - # Write the PID file only after forking. - with open(pidfile, 'w') as f: - f.write(str(os.getpid())) + if not args.no_pid: + # Write the PID file only after forking. + with open(pidfile, 'w') as f: + f.write(str(os.getpid())) # Load configured plugins to_load = conf.conf['plugins']