# HG changeset patch # User Marcin Kuzminski # Date 2012-07-07 13:43:16 # Node ID 29e999f26998a1741e443c0bb3ef1f65801ae3b3 # Parent 5fe0f744bec040f2798e3913da9f334e726cee81 pidlock always create dirs for lock file diff --git a/rhodecode/lib/pidlock.py b/rhodecode/lib/pidlock.py --- a/rhodecode/lib/pidlock.py +++ b/rhodecode/lib/pidlock.py @@ -8,6 +8,7 @@ from multiprocessing.util import Finaliz from rhodecode.lib.compat import kill + class LockHeld(Exception): pass @@ -123,6 +124,10 @@ class DaemonLock(object): """ if self.debug: print 'creating a file %s and pid: %s' % (pidfile, lockname) + + dir_, file_ = os.path.split(pidfile) + if not os.path.isdir(dir_): + os.makedirs(dir_) pidfile = open(self.pidfile, "wb") pidfile.write(lockname) pidfile.close