ACK Chrissie On 27/05/14 16:37, Jan Friesse wrote:
Signed-off-by: Jan Friesse <jfriesse@xxxxxxxxxx> --- exec/logsys.c | 17 ++++++++++++++++- 1 files changed, 16 insertions(+), 1 deletions(-) diff --git a/exec/logsys.c b/exec/logsys.c index 8270da7..6b4995d 100644 --- a/exec/logsys.c +++ b/exec/logsys.c @@ -309,6 +309,7 @@ int _logsys_system_setup( int i; int32_t fidx; char tempsubsys[LOGSYS_MAX_SUBSYS_NAMELEN]; + int blackbox_enable_res; if ((mainsystem == NULL) || (strlen(mainsystem) >= LOGSYS_MAX_SUBSYS_NAMELEN)) { @@ -333,6 +334,12 @@ int _logsys_system_setup( * _logsys_subsys_filename_add (i, "util.c"); */ + /* + * This file (logsys.c) is not exactly QB. We need tag for logsys.c if flightrecorder init + * fails, and QB seems to be closest. + */ + _logsys_subsys_filename_add (i, "logsys.c"); + i = LOGSYS_MAX_SUBSYS_COUNT; pthread_mutex_lock (&logsys_config_mutex); @@ -364,7 +371,7 @@ int _logsys_system_setup( QB_LOG_FILTER_FILE, "*", LOG_TRACE); qb_log_ctl(QB_LOG_BLACKBOX, QB_LOG_CONF_SIZE, IPC_LOGSYS_SIZE); qb_log_ctl(QB_LOG_BLACKBOX, QB_LOG_CONF_THREADED, QB_FALSE); - qb_log_ctl(QB_LOG_BLACKBOX, QB_LOG_CONF_ENABLED, QB_TRUE); + blackbox_enable_res = qb_log_ctl(QB_LOG_BLACKBOX, QB_LOG_CONF_ENABLED, QB_TRUE); if (logsys_format_set(NULL) == -1) { return -1; @@ -390,6 +397,14 @@ int _logsys_system_setup( } } + if (blackbox_enable_res < 0) { + LOGSYS_PERROR (-blackbox_enable_res, LOGSYS_LEVEL_WARNING, + "Unable to initialize log flight recorder. "\ + "The most common cause of this error is " \ + "not enough space on /dev/shm. Corosync will continue work, " \ + "but blackbox will not be available"); + } + pthread_mutex_unlock (&logsys_config_mutex); return (0);
_______________________________________________ discuss mailing list discuss@xxxxxxxxxxxx http://lists.corosync.org/mailman/listinfo/discuss