progrium / ginkgo

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

ginkgoctl gives 0 exit code and no errors if services fail to start #69

Open hblanks opened 12 years ago

hblanks commented 12 years ago

When starting a broken service with ginkgoctl, everything looks hunky dory:

# ginkgoctl ../collector.conf.py start || echo fail
Starting process with ../collector.conf.py...

But in fact, an exception had occurred somewhere inside the user's service:

# ginkgo ../collector.conf.py  
Starting process with ../collector.conf.py...
Traceback (most recent call last):
  File "/usr/local/python/bin/ginkgo", line 9, in <module>
    load_entry_point('Ginkgo==0.5.0dev', 'console_scripts', 'ginkgo')()
  File "/usr/local/python-2.7/lib/python2.7/site-packages/Ginkgo-0.5.0dev-py2.7.egg/ginkgo/runner.py", line 44, in run_ginkgo
    ControlInterface().start(args.target)
  File "/usr/local/python-2.7/lib/python2.7/site-packages/Ginkgo-0.5.0dev-py2.7.egg/ginkgo/runner.py", line 142, in start
    app.serve_forever()
  File "/usr/local/python-2.7/lib/python2.7/site-packages/Ginkgo-0.5.0dev-py2.7.egg/ginkgo/core.py", line 166, in serve_forever
    self.start()
  File "/usr/local/python-2.7/lib/python2.7/site-packages/Ginkgo-0.5.0dev-py2.7.egg/ginkgo/core.py", line 107, in start
    child.start(block_until_ready)
  File "/usr/local/python-2.7/lib/python2.7/site-packages/Ginkgo-0.5.0dev-py2.7.egg/ginkgo/core.py", line 107, in start
    child.start(block_until_ready)
  File "/usr/local/python-2.7/lib/python2.7/site-packages/Ginkgo-0.5.0dev-py2.7.egg/ginkgo/core.py", line 107, in start
    child.start(block_until_ready)
  File "/usr/local/python-2.7/lib/python2.7/site-packages/Ginkgo-0.5.0dev-py2.7.egg/ginkgo/core.py", line 109, in start
    ready = not self.do_start()
  ...
  and on down into the user's code.

This is a problem, since it's not possible for init.d scripts to detect whether or not they successfully started a ginkgo service.

progrium commented 12 years ago

Related: https://github.com/progrium/ginkgo/issues/53