diff --git a/daemons/ganeti-masterd b/daemons/ganeti-masterd index 6400e2f77678dfd211f06c11a38bf64f8e1b3c33..035c229b11c2f4f9243740252b3c8a0123d853d7 100755 --- a/daemons/ganeti-masterd +++ b/daemons/ganeti-masterd @@ -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() diff --git a/lib/constants.py b/lib/constants.py index 4d48cbf206824ff72b511878679f8dd29c81dcc8..fe13e27b43ffee70a631e997bf65a8e4fe2aadae 100644 --- a/lib/constants.py +++ b/lib/constants.py @@ -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"