diff --git a/exec/apidef.c b/exec/apidef.c index 5746b484..656a6988 100644 --- a/exec/apidef.c +++ b/exec/apidef.c @@ -140,7 +140,8 @@ static struct corosync_api_v1 apidef_corosync_api_v1 = { .plugin_interface_release = lcr_ifact_release, .error_memory_failure = _corosync_out_of_memory_error, .fatal_error = _corosync_public_exit_error, - .request_shutdown = corosync_request_shutdown + .request_shutdown = corosync_request_shutdown, + .state_dump = corosync_state_dump }; void apidef_init (struct objdb_iface_ver0 *objdb) { diff --git a/exec/main.c b/exec/main.c index 65116b6a..cfdf8129 100644 --- a/exec/main.c +++ b/exec/main.c @@ -124,7 +124,7 @@ hdb_handle_t corosync_poll_handle; struct sched_param global_sched_param; -static void sigusr2_handler (int num) +void corosync_state_dump (void) { int i; @@ -135,6 +135,15 @@ static void sigusr2_handler (int num) } } +static void sigusr2_handler (int num) +{ + /* + * TODO remove this from sigusr2 handler and access via cfg service + * engine api - corosync-cfgtool + */ + corosync_state_dump (); +} + /* * TODO this function needs some love */ diff --git a/exec/main.h b/exec/main.h index bc76dc87..a26c064f 100644 --- a/exec/main.h +++ b/exec/main.h @@ -66,4 +66,6 @@ extern int message_source_is_local (const mar_message_source_t *source); extern void corosync_request_shutdown (void); +extern void corosync_state_dump (void); + #endif /* MAIN_H_DEFINED */ diff --git a/include/corosync/engine/coroapi.h b/include/corosync/engine/coroapi.h index bee174a0..f3a1c983 100644 --- a/include/corosync/engine/coroapi.h +++ b/include/corosync/engine/coroapi.h @@ -576,6 +576,8 @@ struct corosync_api_v1 { void (*fatal_error) (cs_fatal_error_t err, const char *file, unsigned int line); void (*request_shutdown) (void); + + void (*state_dump) (void); }; #define SERVICE_ID_MAKE(a,b) ( ((a)<<16) | (b) )