comparison py/tempserver.py @ 174:c49d87bb81b9

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 5821c5fab919
children be579bcf3c7f
comparison
equal deleted inserted replaced
173:964c32e9f8a2 174:c49d87bb81b9
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: