Forward-port DrbdNetReconfig
[ganeti-local] / daemons / ganeti-masterd
index 5e524d9..ac0af6d 100755 (executable)
@@ -402,9 +402,9 @@ def CheckAgreement():
       continue
     break
   if retries == 0:
-      logging.critical("Cluster inconsistent, most of the nodes didn't answer"
-                       " after multiple retries. Aborting startup")
-      return False
+    logging.critical("Cluster inconsistent, most of the nodes didn't answer"
+                     " after multiple retries. Aborting startup")
+    return False
   # here a real node is at the top of the list
   all_votes = sum(item[1] for item in votes)
   top_node, top_votes = votes[0]
@@ -429,6 +429,9 @@ def main():
   utils.debug = options.debug
   utils.no_fork = True
 
+  if options.fork:
+    utils.CloseFDs()
+
   rpc.Init()
   try:
     ssconf.CheckMaster(options.debug)
@@ -460,8 +463,7 @@ def main():
 
   # become a daemon
   if options.fork:
-    utils.Daemonize(logfile=constants.LOG_MASTERDAEMON,
-                    noclose_fds=[master.fileno()])
+    utils.Daemonize(logfile=constants.LOG_MASTERDAEMON)
 
   utils.WritePidFile(constants.MASTERD_PID)
   try: