From 8864e7d8ab05b59372f55ec8d637296aefa1515e Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 1 Nov 2010 18:52:11 +0100 Subject: abrt-handle-crashdump: new semi-debug utility to run abrt actions for a specified event Some reworking of run_action() API was needed to make it possible to put it into libABRT. abrt-handle-crashdump has no -l option yet: $ abrt-handle-crashdump Usage: abrt-handle-crashdump [-vs] -d DIR -e EVENT Handle crash dump according to rules in abrt_action.conf -v, --verbose be verbose -s Log to syslog -d DIR Crash dump directory -e EVENT Event Can (will) extend it later. Run-tested: performed "analyze" step by hand with abrt-handle-crashdump -e analyze -d CRASH_DUMP_DIR Signed-off-by: Denys Vlasenko --- inc/abrtlib.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'inc/abrtlib.h') diff --git a/inc/abrtlib.h b/inc/abrtlib.h index f9796ada..52896fe9 100644 --- a/inc/abrtlib.h +++ b/inc/abrtlib.h @@ -213,6 +213,18 @@ char* get_cmdline(pid_t pid); /* Returns 1 if abrtd daemon is running, 0 otherwise. */ int daemon_is_ok(); +struct run_event_state { + int (*post_run_callback)(const char *dump_dir_name, void *param); + void *post_run_param; + char* (*logging_callback)(char *log_line, void *param); + void *logging_param; +}; +static inline struct run_event_state *new_run_event_state() + { return (struct run_event_state*)xzalloc(sizeof(struct run_event_state)); } +static inline void free_run_event_state(struct run_event_state *state) + { free(state); } +int run_event(struct run_event_state *state, const char *dump_dir_name, const char *event); + #ifdef __cplusplus } #endif -- cgit