Commit 9894ece7 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Use Linux-specific way to name master socket

By using this Linux-specific way we don't have to care about removing the
socket file when quitting or starting (after an unclean shutdown). For a
more detailed description, see the comment in the patch.

Reviewed-by: schreiberal
parent fc28c086
......@@ -127,7 +127,6 @@ class IOServer(SocketServer.UnixStreamServer):
"""
try:
self.server_close()
utils.RemoveFile(constants.MASTER_SOCKET)
finally:
if self.request_workers:
self.request_workers.TerminateWorkers()
......
......@@ -95,7 +95,19 @@ SSH_KNOWN_HOSTS_FILE = DATA_DIR + "/known_hosts"
QUEUE_DIR = DATA_DIR + "/queue"
ETC_HOSTS = "/etc/hosts"
DEFAULT_FILE_STORAGE_DIR = _autoconf.FILE_STORAGE_DIR
MASTER_SOCKET = RUN_GANETI_DIR + "/master.sock"
# Quoting unix(7) on Linux:
# Linux also supports an abstract namespace which is independent of the file
# system. [...] If sun_path starts with a null byte ('\0'), then it refers to
# the abstract namespace maintained by the Unix protocol module. The socket's
# address in this namespace is given by the rest of the bytes in sun_path.
#
# By using this Linux-specific way we don't have to care about removing the
# socket file when quitting or starting (after an unclean shutdown).
#
# Sample output for "netstat -nlp":
# unix 2 [ ACC ] STREAM LISTENING 247919 1234/python @ganeti-master
MASTER_SOCKET = "\0ganeti-master"
# PID files
MASTERD_PID = "ganeti-masterd"
......
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