Commit 99e88451 authored by Iustin Pop's avatar Iustin Pop
Browse files

Use constants for the pid file stems

Reviewed-by: imsnah
parent b2a1f511
......@@ -329,7 +329,7 @@ def main():
utils.Daemonize(logfile=constants.LOG_MASTERDAEMON,
noclose_fds=[master.fileno()])
utils.WritePidFile('ganeti-masterd')
utils.WritePidFile(constants.MASTERD_PID)
logger.SetupDaemon(constants.LOG_MASTERDAEMON, debug=options.debug,
stderr_logging=not options.fork)
......@@ -341,7 +341,7 @@ def main():
master.serve_forever()
finally:
master.server_cleanup()
utils.RemovePidFile('ganeti-masterd')
utils.RemovePidFile(constants.MASTERD_PID)
if __name__ == "__main__":
......
......@@ -615,7 +615,7 @@ def main():
if options.fork:
utils.Daemonize(logfile=constants.LOG_NODESERVER)
utils.WritePidFile('ganeti-noded')
utils.WritePidFile(constants.NODED_PID)
logger.SetupDaemon(logfile=constants.LOG_NODESERVER, debug=options.debug,
stderr_logging=not options.fork)
......@@ -629,7 +629,7 @@ def main():
try:
server.serve_forever()
finally:
utils.RemovePidFile('ganeti-noded')
utils.RemovePidFile(constants.NODED_PID)
if __name__ == '__main__':
......
......@@ -132,7 +132,7 @@ def main():
if options.fork:
utils.Daemonize(logfile=constants.LOG_RAPISERVER)
utils.WritePidFile('ganeti-rapi')
utils.WritePidFile(constants.RAPI_PID)
log_fd = open(constants.LOG_RAPIACCESS, 'a')
try:
......@@ -143,7 +143,7 @@ def main():
httpd.serve_forever()
finally:
httpd.server_close()
utils.RemovePidFile('ganeti-rapi')
utils.RemovePidFile(constants.RAPI_PID)
finally:
log_fd.close()
......
......@@ -97,6 +97,11 @@ ETC_HOSTS = "/etc/hosts"
DEFAULT_FILE_STORAGE_DIR = _autoconf.FILE_STORAGE_DIR
MASTER_SOCKET = RUN_GANETI_DIR + "/master.sock"
# PID files
MASTERD_PID = "ganeti-master"
NODED_PID = "ganeti-noded"
RAPI_PID = "ganeti-rapi"
NODE_INITD_SCRIPT = _autoconf.SYSCONFDIR + "/init.d/ganeti"
DEFAULT_NODED_PORT = 1811
FIRST_DRBD_PORT = 11000
......
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