Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
...@@ -132,6 +132,8 @@ def main(): ...@@ -132,6 +132,8 @@ def main():
if options.fork: if options.fork:
utils.Daemonize(logfile=constants.LOG_RAPISERVER) utils.Daemonize(logfile=constants.LOG_RAPISERVER)
utils.WritePidFile('ganeti-rapi')
log_fd = open(constants.LOG_RAPIACCESS, 'a') log_fd = open(constants.LOG_RAPIACCESS, 'a')
try: try:
apache_log = http.ApacheLogfile(log_fd) apache_log = http.ApacheLogfile(log_fd)
...@@ -141,6 +143,7 @@ def main(): ...@@ -141,6 +143,7 @@ def main():
httpd.serve_forever() httpd.serve_forever()
finally: finally:
httpd.server_close() httpd.server_close()
utils.RemovePidFile('ganeti-rapi')
finally: finally:
log_fd.close() log_fd.close()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment