Skip to content

Commit

Permalink
logging: Reopen blackbox after tty detach
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
  • Loading branch information
jfriesse committed Jan 22, 2018
1 parent 6ed7141 commit d6b7aa8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions exec/logsys.c
Expand Up @@ -861,3 +861,15 @@ void logsys_blackbox_set(int enable)

pthread_mutex_unlock (&logsys_config_mutex);
}

/*
* To set correct pid to qb blackbox filename after tty dettach (fork) we have to
* close and (if needed) reopen blackbox.
*/
void logsys_blackbox_handle_detach(void)
{

(void)qb_log_ctl(QB_LOG_BLACKBOX, QB_LOG_CONF_ENABLED, QB_FALSE);

_logsys_config_apply_blackbox();
}
2 changes: 2 additions & 0 deletions exec/main.c
Expand Up @@ -1443,6 +1443,8 @@ int main (int argc, char **argv, char **envp)
*/
if (background) {
corosync_tty_detach ();

logsys_blackbox_handle_detach();
}

/*
Expand Down
3 changes: 3 additions & 0 deletions include/corosync/logsys.h
Expand Up @@ -258,6 +258,9 @@ extern int logsys_thread_start (void);

extern void logsys_blackbox_set(int enable);

extern void logsys_blackbox_handle_detach(void);


/**
* @brief logsys_subsys_id
*/
Expand Down

0 comments on commit d6b7aa8

Please sign in to comment.