Commit f71245a0 authored by Iustin Pop's avatar Iustin Pop
Browse files

Make the rapi daemon create a pidfile

This is needed for controlling it cleanly with start-stop daemon.

Reviewed-by: ultrotter
parent 6760471c
......@@ -132,6 +132,8 @@ def main():
if options.fork:
utils.Daemonize(logfile=constants.LOG_RAPISERVER)
utils.WritePidFile('ganeti-rapi')
log_fd = open(constants.LOG_RAPIACCESS, 'a')
try:
apache_log = http.ApacheLogfile(log_fd)
......@@ -141,6 +143,7 @@ def main():
httpd.serve_forever()
finally:
httpd.server_close()
utils.RemovePidFile('ganeti-rapi')
finally:
log_fd.close()
......
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