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

Merge trunk revision 2385:
r2385 | fabbione | 2009-08-11 23:57:53 -0700 (Tue, 11 Aug 2009) | 5 lines

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/branches/flatiron@2438 fd59a12c-fef9-0310-b244-a6a79926bd2f

Steven Dake 16 лет назад
Родитель
Сommit
34be13d381
1 измененных файлов с 8 добавлено и 4 удалено
  1. 8 4
      exec/main.c

+ 8 - 4
exec/main.c

@@ -781,9 +781,6 @@ int main (int argc, char **argv)
 		}
 		}
 	}
 	}
 
 
-	if (background)
-		corosync_tty_detach ();
-
 	/*
 	/*
 	 * Set round robin realtime scheduling with priority 99
 	 * Set round robin realtime scheduling with priority 99
 	 * Lock all memory to avoid page faults which may interrupt
 	 * Lock all memory to avoid page faults which may interrupt
@@ -897,7 +894,6 @@ int main (int argc, char **argv)
 		syslog (LOGSYS_LEVEL_ERROR, "%s", error_string);
 		syslog (LOGSYS_LEVEL_ERROR, "%s", error_string);
 		corosync_exit_error (AIS_DONE_MAINCONFIGREAD);
 		corosync_exit_error (AIS_DONE_MAINCONFIGREAD);
 	}
 	}
-	logsys_fork_completed();
 
 
 	/*
 	/*
 	 * Make sure required directory is present
 	 * Make sure required directory is present
@@ -960,6 +956,14 @@ int main (int argc, char **argv)
 		corosync_exit_error (AIS_DONE_MAINCONFIGREAD);
 		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
 	 * Sleep for a while to let other nodes in the cluster
 	 * understand that this node has been away (if it was
 	 * understand that this node has been away (if it was