Mercurial > templog
comparison py/tempserver.py @ 473:bd29ddb360a5
fix to absolute path for lockfile, --daemon does chdir("/")
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Thu, 25 Jul 2013 08:03:14 +0800 |
parents | 4414bf8dddaa |
children | be579bcf3c7f |
comparison
equal
deleted
inserted
replaced
472:b096fc6d1ef4 | 473:bd29ddb360a5 |
---|---|
101 server.run() | 101 server.run() |
102 | 102 |
103 def main(): | 103 def main(): |
104 setup_logging() | 104 setup_logging() |
105 | 105 |
106 pidpath = os.path.join(os.path.dirname(__file__), 'tempserver.pid') | 106 heredir = os.path.abspath(os.path.dirname(__file__)) |
107 pidpath = os.path.join(heredir, 'tempserver.pid') | |
107 pidf = lockfile.pidlockfile.PIDLockFile(pidpath, threaded=False) | 108 pidf = lockfile.pidlockfile.PIDLockFile(pidpath, threaded=False) |
108 try: | 109 try: |
109 pidf.acquire(0) | 110 pidf.acquire(0) |
110 pidf.release() | 111 pidf.release() |
111 except lockfile.AlreadyLocked, e: | 112 except lockfile.AlreadyLocked, e: |