From 8dd6b9d47100a65d50ba69522e06aa55a32b60a9 Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Tue, 1 Dec 2020 00:47:14 +0100 Subject: [PATCH] Fix a strange problem with saved PID file between runs --- Dockerfile | 2 +- nemubot/__main__.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index c61d8be..015d678 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,5 +21,5 @@ COPY requirements.txt ./ COPY --from=pybuild /usr/local/lib/python3.9 /usr/lib/python3.9 COPY . . -ENTRYPOINT [ "python", "-m", "nemubot", "-d", "-M", "/usr/src/app/modules" ] +ENTRYPOINT [ "python", "-m", "nemubot", "-d", "-P", "", "-M", "/usr/src/app/modules" ] CMD [ "-D", "/var/lib/nemubot" ] \ No newline at end of file diff --git a/nemubot/__main__.py b/nemubot/__main__.py index abb290b..4275d95 100644 --- a/nemubot/__main__.py +++ b/nemubot/__main__.py @@ -71,8 +71,8 @@ def main(): # Resolve relatives paths args.data_path = os.path.abspath(os.path.expanduser(args.data_path)) - args.pidfile = os.path.abspath(os.path.expanduser(args.pidfile)) - args.socketfile = os.path.abspath(os.path.expanduser(args.socketfile)) + args.pidfile = os.path.abspath(os.path.expanduser(args.pidfile)) if args.pidfile is not None and args.pidfile != "" else None + args.socketfile = os.path.abspath(os.path.expanduser(args.socketfile)) if args.socketfile is not None and args.socketfile != "" else None args.logfile = os.path.abspath(os.path.expanduser(args.logfile)) args.files = [x for x in map(os.path.abspath, args.files)] args.modules_path = [x for x in map(os.path.abspath, args.modules_path)]