Use the 'good' version of pidlockfile
authorJon Turney <jon.turney@dronecode.org.uk>
Sat, 26 Jul 2025 12:57:04 +0000 (13:57 +0100)
committerJon Turney <jon.turney@dronecode.org.uk>
Sat, 26 Jul 2025 12:57:04 +0000 (13:57 +0100)
Use the improved version of pidlockfile, where locks are implicitly
released when the process is no longer running.

Otherwise we are prevented from starting just by the existence of the
lockfile, even if the previous process was terminated abnormally.

calm/calm.py
requirements.txt

index f253812b61a77c91b0351f1e5875633b1ac59e54..a5e2b078303cbfb50cf7b36012c4ed91535d30c6 100755 (executable)
@@ -660,7 +660,7 @@ class Event(Flag):
 def do_daemon(args, state):
     import daemon
     import inotify.adapters
-    import lockfile.pidlockfile
+    import pidlockfile
 
     logging.getLogger('inotify.adapters').propagate = False
 
@@ -678,7 +678,7 @@ def do_daemon(args, state):
         stderr=sys.stderr,
         files_preserve=getLogFileDescriptors(logging.getLogger()),
         umask=0o002,
-        pidfile=lockfile.pidlockfile.PIDLockFile(args.daemon))
+        pidfile=pidlockfile.PIDLockFile(args.daemon))
 
     # XXX: running flag isn't actually doing anything anymore so can be removed
     running = True
index 3cb6f87943eec5c6ffbfcfc65d0d6e59825286e0..62cc827a0ef420c4269583911aa329b32a8b8b68 100644 (file)
@@ -4,8 +4,8 @@ flake8-bugbear ; python_version >= "3.5"
 flake8-builtins
 flake8-import-order
 license_expression
-lockfile
 markdown
+pidlockfile
 pycodestyle
 python-daemon
 xtarfile[zstd]
This page took 0.060811 seconds and 5 git commands to generate.