Browse Source

Try to handle broken pid files.

Ask Solem 15 years ago
parent
commit
201287922d
1 changed files with 4 additions and 0 deletions
  1. 4 0
      celery/bin/celeryd.py

+ 4 - 0
celery/bin/celeryd.py

@@ -168,6 +168,10 @@ def acquire_pidlock(pidfile):
             sys.stderr.write("Stale pidfile exists. Removing it.\n")
             os.unlink(pidfile)
             return PIDLockFile(pidfile)
+    except TypeError, exc:
+        sys.stderr.write("Broken pidfile found. Removing it.\n")
+        os.unlink(pidfile)
+        return PIDLockFile(pidfile)
     else:
         raise SystemExit(
                 "ERROR: Pidfile (%s) already exists.\n"