From 367a88ffa591219f6e7028a6a544e521531dee8f Mon Sep 17 00:00:00 2001 From: Jonathan Weth Date: Thu, 30 Jul 2020 15:54:06 +0200 Subject: Store lock file in own directory in /tmp/ --- service.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/service.py b/service.py index 7a36235..339008e 100755 --- a/service.py +++ b/service.py @@ -233,7 +233,9 @@ def str2bool(v: Union[str, bool, int]) -> bool: if __name__ == "__main__": - lock_file_path = os.path.join(tempfile.gettempdir(), "rwa-session-service.lock") + lock_dir_path = os.path.join(tempfile.gettempdir(), "rwa-session-service") + os.makedirs(lock_dir_path, exist_ok=True) + lock_file_path = os.path.join(lock_dir_path, "rwa-session-service.lock") # Check for lock file if os.path.exists(lock_file_path): -- cgit v1.2.3