From: Eric Bollengier Date: Wed, 12 Nov 2008 14:24:06 +0000 (+0000) Subject: ebl Add plugin list to status dir command output X-Git-Tag: Release-3.0.0~584 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=29b4e1b0779f6e0c5c9c476665ba97c354b15d7b;p=bacula%2Fbacula ebl Add plugin list to status dir command output git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8041 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/dird/dir_plugins.h b/bacula/src/dird/dir_plugins.h index 7db456bc6c..25673fb5cb 100644 --- a/bacula/src/dird/dir_plugins.h +++ b/bacula/src/dird/dir_plugins.h @@ -98,13 +98,14 @@ typedef enum { bwVarJobReport = 1, bwVarVolumeName = 2, bwVarPriority = 3, - bwVarJobLevel = 4, + bwVarJobLevel = 4 } bwVariable; typedef enum { bEventJobStart = 1, bEventJobEnd = 2, + bEventExit = 3 } bEventType; typedef struct s_bEvent { diff --git a/bacula/src/dird/ua_status.c b/bacula/src/dird/ua_status.c index bb49e4e2a2..4291b51f74 100644 --- a/bacula/src/dird/ua_status.c +++ b/bacula/src/dird/ua_status.c @@ -307,6 +307,23 @@ void list_dir_status_header(UAContext *ua) edit_uint64_with_commas(sm_max_bytes, b3), edit_uint64_with_commas(sm_buffers, b4), edit_uint64_with_commas(sm_max_buffers, b5)); + + /* TODO: use this function once for all daemons */ + if (debug_level > 0 && plugin_list->size() > 0) { + int len; + Plugin *plugin; + POOL_MEM msg(PM_FNAME); + pm_strcpy(msg, " Plugin: "); + foreach_alist(plugin, plugin_list) { + len = pm_strcat(msg, plugin->file); + if (len > 80) { + pm_strcat(msg, "\n "); + } else { + pm_strcat(msg, " "); + } + } + ua->send_msg("%s\n", msg.c_str()); + } } static void do_director_status(UAContext *ua) diff --git a/bacula/src/filed/status.c b/bacula/src/filed/status.c index 7b646476e6..4ee3c13685 100644 --- a/bacula/src/filed/status.c +++ b/bacula/src/filed/status.c @@ -146,7 +146,7 @@ static void list_status_header(STATUS_PKT *sp) if (debug_level > 0 && plugin_list->size() > 0) { Plugin *plugin; int len; - pm_strcpy(msg, "Plugin="); + pm_strcpy(msg, "Plugin: "); foreach_alist(plugin, plugin_list) { len = pm_strcat(msg, plugin->file); if (len > 80) { diff --git a/bacula/src/plugins/dir/Makefile.in b/bacula/src/plugins/dir/Makefile.in index 0a6fa27c08..8cb08df2e4 100644 --- a/bacula/src/plugins/dir/Makefile.in +++ b/bacula/src/plugins/dir/Makefile.in @@ -31,7 +31,7 @@ main: dir_plugins.o $(CXX) $(LDFLAGS) -L${LIBDIR} dir_plugins.o -o main -lbac -lpthread -lssl -l crypto -ldl example-plugin-dir.o: example-plugin-dir.c ${DIRDIR}/dir_plugins.h - $(CXX) -fPIC -I../.. -I${DIRDIR} -c example-plugin-fd.c + $(CXX) -fPIC -I../.. -I${DIRDIR} -c example-plugin-dir.c example-plugin-dir.so: example-plugin-dir.o $(CXX) $(LDFLAGS) -shared example-plugin-dir.o -o example-plugin-dir.so diff --git a/bacula/technotes-2.5 b/bacula/technotes-2.5 index f2f5760b34..92396b0a5e 100644 --- a/bacula/technotes-2.5 +++ b/bacula/technotes-2.5 @@ -11,6 +11,10 @@ mixed priorities General: 12Nov08 +ebl Do work on plugins + - fix compilation of the director plugins + - add plugin list to status dir output + - add director plugin dump after a fatal signal ebl Apply Riccardo's patch that fix some win32 compilation errors and a bug with bat version browser. 11Nov08