Hi Steve,

> I am not sure why openais doesn't log to /var/log/openais.log even
> though your configuration file indicates it should.  Could you please
> provide the version number of openais you are using?  This is probably a
> new issue with logging that needs to be addressed.

I noticed this problem the other day. Please try this patch (attached & inline).
If the LOG_MODE_OUTPUT_FILE mode hasn't been set when logsys_config_file_set()
is called, the log file won't be opened..

Regards,
Tim

diff --git a/exec/main.c b/exec/main.c
index 2aed731..d1b42f5 100644
--- a/exec/main.c
+++ b/exec/main.c
@@ -569,13 +569,13 @@ int main (int argc, char **argv)
                openais_exit_error (AIS_DONE_MAINCONFIGREAD);
        }

+       logsys_config_mode_set (main_config.logmode);
        res = logsys_config_file_set (&error_string, main_config.logfile);
        if (res == -1) {
                log_printf (LOG_LEVEL_ERROR, error_string);
                openais_exit_error (AIS_DONE_LOGSETUP);
        }
        logsys_config_facility_set ("openais", main_config.syslog_facility);
-       logsys_config_mode_set (main_config.logmode);

        aisexec_uid_determine (&main_config);
diff --git a/exec/main.c b/exec/main.c
index 2aed731..d1b42f5 100644
--- a/exec/main.c
+++ b/exec/main.c
@@ -569,13 +569,13 @@ int main (int argc, char **argv)
 		openais_exit_error (AIS_DONE_MAINCONFIGREAD);
 	}
 
+	logsys_config_mode_set (main_config.logmode);
 	res = logsys_config_file_set (&error_string, main_config.logfile);
 	if (res == -1) {
 		log_printf (LOG_LEVEL_ERROR, error_string);
 		openais_exit_error (AIS_DONE_LOGSETUP);
 	}
 	logsys_config_facility_set ("openais", main_config.syslog_facility);
-	logsys_config_mode_set (main_config.logmode);
 
 	aisexec_uid_determine (&main_config);
 
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to