From f1952d0e971581bbe72be9eb5538dff1508b7856 Mon Sep 17 00:00:00 2001 From: Pumba98 Date: Sun, 27 Feb 2022 13:44:26 +0100 Subject: [PATCH 1/2] Update start.py --- core/postfix/start.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/postfix/start.py b/core/postfix/start.py index dc5015d7..c54b884d 100755 --- a/core/postfix/start.py +++ b/core/postfix/start.py @@ -15,7 +15,8 @@ log.basicConfig(stream=sys.stderr, level=os.environ.get("LOG_LEVEL", "WARNING")) def start_podop(): os.setuid(getpwnam('postfix').pw_uid) - os.mkdir('/dev/shm/postfix',mode=0o700) + if not os.path.exists('/dev/shm/postfix'): + os.mkdir('/dev/shm/postfix',mode=0o700) url = "http://" + os.environ["ADMIN_ADDRESS"] + "/internal/postfix/" # TODO: Remove verbosity setting from Podop? run_server(0, "postfix", "/tmp/podop.socket", [ From 193d835abeb91928a8c59cbf1345056c4f32b4c1 Mon Sep 17 00:00:00 2001 From: Florent Daigniere Date: Mon, 18 Apr 2022 11:19:50 +0200 Subject: [PATCH 2/2] Use os.makedirs instead --- core/postfix/start.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/postfix/start.py b/core/postfix/start.py index c54b884d..32c0c0e8 100755 --- a/core/postfix/start.py +++ b/core/postfix/start.py @@ -15,8 +15,7 @@ log.basicConfig(stream=sys.stderr, level=os.environ.get("LOG_LEVEL", "WARNING")) def start_podop(): os.setuid(getpwnam('postfix').pw_uid) - if not os.path.exists('/dev/shm/postfix'): - os.mkdir('/dev/shm/postfix',mode=0o700) + os.makedirs('/dev/shm/postfix',mode=0o700, exist_ok=True) url = "http://" + os.environ["ADMIN_ADDRESS"] + "/internal/postfix/" # TODO: Remove verbosity setting from Podop? run_server(0, "postfix", "/tmp/podop.socket", [