Commit e025bfd0 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

equeue: fix restart problem by removing socket

parent 72ae7f9c
......@@ -27,6 +27,7 @@
##############################################################################
import argparse
import errno
import gdbm
import json
import logging
......@@ -143,10 +144,16 @@ def main():
signal.signal(signal.SIGHUP, lambda *args: sys.exit(-1))
signal.signal(signal.SIGTERM, lambda *args: sys.exit())
try:
server = EqueueServer(socketpath, **{'equeue_options':args})
server.logger.info("Starting server on %r", socketpath)
server.serve_forever()
finally:
try:
os.remove(socketpath)
except OSError, e:
if e.errno != errno.ENOENT:
raise
if __name__ == '__main__':
main()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment