Detach tty as late as possible to give a chance to corosync startup
wrappers (cman and possibly others) to collect as much output
as possible from stderr in case of errors.

Signed-off-by: Fabio M. Di Nitto <[email protected]>
---
:100644 100644 edaa69f... 3aa52df... M  exec/main.c
 exec/main.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/exec/main.c b/exec/main.c
index edaa69f..3aa52df 100644
--- a/exec/main.c
+++ b/exec/main.c
@@ -770,9 +770,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
@@ -886,7 +883,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
@@ -1035,6 +1031,14 @@ int main (int argc, char **argv)
        coroipcs_ipc_init (&ipc_init_state);
 
        /*
+        * Now we are fully initialized
+        */
+       if (background) {
+               corosync_tty_detach ();
+       }
+       logsys_fork_completed();
+
+       /*
         * Start main processing loop
         */
        poll_run (corosync_poll_handle);
-- 
1.5.4.3

_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to