As an admin I want that the init scripts fail if it fails to launch the python process
fbernitt opened this issue · comments
Background:
Currently we have a problem with the init scripts for the dispatcher. The way they are currently launched using /etc/init.d/pixelated-dispatcher-manager or /etc/init.d/pixelated-dispatcher-proxy and the python process fails to start because of missing dependencies or dependencies in wrong versions init script tells us that it started the process but that process died milliseconds after that.
It would be great if we could wait for the daemon to launch sucessfully and return an error message otherwise.
This is a timeboxed research task to find an alternative init script implementation.
When I change the PIXELATED_BACKEND to something invalid, the pixelated-dispatcher-manager does not start, and doesn't log anything.
But if python fails, I see that in the output:
root@pixelated:/# /etc/init.d/pixelated-dispatcher-manager start
[....] Starting pixelated-dispatcher manager: pixelated-managerTraceback (most recent call last):
File "/usr/bin/pixelated-dispatcher", line 7, in <module>
nonsense
NameError: name 'nonsense' is not defined
failed!
Thats great!!!
the pixelated-dispatcher-proxy does not listen on 8080 anymore if started with --daemon
When starting in foreground, everything works.
This issue is #90
when the disptacher-proxy sees a lockfile in /var/run/pixelated/pixelated-dispatcher-proxy.pid.lock
it starts but does nothing. When I start the disptacher-proxy multiple times, it runs multiple times but ony one process actually does something.
The dispatcher-proxy should quit with an errormessages if the lockfile is present
I gave the dispatcher-proxy a wrong cert and saw the error in the log. YAY!
Mar 19 11:35:37 pixelated pixelated.dispatcher: ERROR Error while running manager: certfile "/etc/ssl/certs/ssl-cert-snakeoil.pemasdlfkj" does not exist#012Traceback (most recent call last):#012 File "/usr/lib/python2.7/dist-packages/pixelated/proxy/__init__.py", line 328, in serve_forever#012 self._server = HTTPServer(app, ssl_options=self.ssl_options)#012 File "/usr/lib/python2.7/dist-packages/tornado/httpserver.py", line 154, in __init__#012 **kwargs)#012 File "/usr/lib/python2.7/dist-packages/tornado/tcpserver.py", line 103, in __init__#012 self.ssl_options['certfile'])#012ValueError: certfile "/etc/ssl/certs/ssl-cert-snakeoil.pemasdlfkj" does not exist
BUT: It says "ERROR Error while running manager", but it was the proxy that didn't work
cool. This ticket can be launched then