From 86edc3a9191a53dd37c68f1885f27b92d0316b74 Mon Sep 17 00:00:00 2001 From: Florent Daigniere Date: Sun, 27 Nov 2022 09:56:04 +0100 Subject: [PATCH] Close #1483: remove postfix's /queue/pid/master.pid --- core/postfix/start.py | 2 ++ towncrier/newsfragments/1483.bugfix | 1 + 2 files changed, 3 insertions(+) create mode 100644 towncrier/newsfragments/1483.bugfix diff --git a/core/postfix/start.py b/core/postfix/start.py index 509f961a..80c1c4bf 100755 --- a/core/postfix/start.py +++ b/core/postfix/start.py @@ -14,6 +14,8 @@ from socrate import system, conf log.basicConfig(stream=sys.stderr, level=os.environ.get("LOG_LEVEL", "WARNING")) +os.system("flock -n /queue/pid/master.pid rm /queue/pid/master.pid") + def start_podop(): os.setuid(getpwnam('postfix').pw_uid) os.makedirs('/dev/shm/postfix',mode=0o700, exist_ok=True) diff --git a/towncrier/newsfragments/1483.bugfix b/towncrier/newsfragments/1483.bugfix new file mode 100644 index 00000000..16e28f39 --- /dev/null +++ b/towncrier/newsfragments/1483.bugfix @@ -0,0 +1 @@ +Remove postfix's master.pid on startup if there is no other instance running