Просмотр исходного кода

Delay forking and closing of fds as much as possible
to allow startup wrappers (such as cman_tool) to collect
as much errors as possible in case of startup failure



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2385 fd59a12c-fef9-0310-b244-a6a79926bd2f

Fabio M. Di Nitto 16 лет назад
Родитель
Сommit
13f3c5bc6a
1 измененных файлов с 8 добавлено и 4 удалено
  1. 8 4
      exec/main.c

+ 8 - 4
exec/main.c

@@ -795,9 +795,6 @@ int main (int argc, char **argv)
 		}
 	}
 
-	if (background)
-		corosync_tty_detach ();
-
 	/*
 	 * Set round robin realtime scheduling with priority 99
 	 * Lock all memory to avoid page faults which may interrupt
@@ -911,7 +908,6 @@ int main (int argc, char **argv)
 		syslog (LOGSYS_LEVEL_ERROR, "%s", error_string);
 		corosync_exit_error (AIS_DONE_MAINCONFIGREAD);
 	}
-	logsys_fork_completed();
 
 	/*
 	 * Make sure required directory is present
@@ -974,6 +970,14 @@ int main (int argc, char **argv)
 		corosync_exit_error (AIS_DONE_MAINCONFIGREAD);
 	}
 
+	/*
+	 * Now we are fully initialized.
+	 */
+	if (background) {
+		corosync_tty_detach ();
+	}
+	logsys_fork_completed();
+
 	/*
 	 * Sleep for a while to let other nodes in the cluster
 	 * understand that this node has been away (if it was