progrium / ginkgo

Python service microframework
http://ginkgo.readthedocs.org
MIT License
325 stars 51 forks source link

locking pid file failure still returns 0 #12

Closed objcode closed 12 years ago

objcode commented 12 years ago

When starting gservice, if the pidfile lock fails gservice still returns 0. This should be an error return.

Traceback (most recent call last): File "/usr/local/python/bin/gservice", line 8, in load_entry_point('gservice==0.2.0', 'console_scripts', 'gservice')() File "/usr/local/python/lib/python2.7/site-packages/gservice-0.2.0-py2.7.egg/gservice/runner.py", line 22, in main Runner().do_action() File "/usr/local/python/lib/python2.7/site-packages/gservice-0.2.0-py2.7.egg/gservice/runner.py", line 255, in do_action getattr(self, func)(_args, _kwargs) File "/usr/local/python/lib/python2.7/site-packages/gservice-0.2.0-py2.7.egg/gservice/runner.py", line 247, in _start super(Runner, self)._start() File "/usr/local/python/lib/python2.7/site-packages/python_daemon-1.6-py2.7.egg/daemon/runner.py", line 124, in _start self.daemon_context.open() File "/usr/local/python/lib/python2.7/site-packages/python_daemon-1.6-py2.7.egg/daemon/daemon.py", line 346, in open self.pidfile.enter() File "build/bdist.linux-i686/egg/lockfile/init.py", line 226, in enter File "/usr/local/python/lib/python2.7/site-packages/python_daemon-1.6-py2.7.egg/daemon/pidfile.py", line 42, in acquire super(TimeoutPIDLockFile, self).acquire(timeout, _args, _kwargs) File "build/bdist.linux-i686/egg/lockfile/pidlockfile.py", line 85, in acquire lockfile.LockTimeout

progrium commented 12 years ago

Right. We want to catch LockTimeout and display a friendly [ERROR] message and return 1 (or something)

objcode commented 12 years ago

deleting this.