From dcdca13fe844409e3855edd37470bc16bacd5653 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Tue, 11 Sep 2007 17:58:18 +0000 Subject: [PATCH] ebl fix #946 about config test mode which was broken. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5526 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/patches/testing/eblstodo | 1 + bacula/src/dird/dird.c | 16 +++++++++------- bacula/technotes-2.3 | 3 +++ 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/bacula/patches/testing/eblstodo b/bacula/patches/testing/eblstodo index ff8f19021d..5ec22eab42 100644 --- a/bacula/patches/testing/eblstodo +++ b/bacula/patches/testing/eblstodo @@ -124,6 +124,7 @@ bacula : o pb inclusion (distante, locale) o pb exclusion (distante, locale) o pb execution de commande + o pb de config avec test du -t des differents daemon - Utiliser PQescapeStringConn a la place de PQescapeString - Utiliser la lib pcre - Rendre les scripts bacula-ctl-xxx LSB diff --git a/bacula/src/dird/dird.c b/bacula/src/dird/dird.c index d34acd8efb..2b30c065c5 100644 --- a/bacula/src/dird/dird.c +++ b/bacula/src/dird/dird.c @@ -228,15 +228,17 @@ int main (int argc, char *argv[]) Jmsg((JCR *)NULL, M_ERROR_TERM, 0, _("Please correct configuration file: %s\n"), configfile); } - if (background) { - daemon_start(); - init_stack_dump(); /* grab new pid */ + if (!test_config) { /* we don't need to do this block in test mode */ + if (background) { + daemon_start(); + init_stack_dump(); /* grab new pid */ + } + + /* Create pid must come after we are a daemon -- so we have our final pid */ + create_pid_file(director->pid_directory, "bacula-dir", get_first_port_host_order(director->DIRaddrs)); + read_state_file(director->working_directory, "bacula-dir", get_first_port_host_order(director->DIRaddrs)); } - /* Create pid must come after we are a daemon -- so we have our final pid */ - create_pid_file(director->pid_directory, "bacula-dir", get_first_port_host_order(director->DIRaddrs)); - read_state_file(director->working_directory, "bacula-dir", get_first_port_host_order(director->DIRaddrs)); - drop(uid, gid); /* reduce privileges if requested */ if (!check_catalog()) { diff --git a/bacula/technotes-2.3 b/bacula/technotes-2.3 index 4ff42e2a9c..b96674ebe1 100644 --- a/bacula/technotes-2.3 +++ b/bacula/technotes-2.3 @@ -1,6 +1,9 @@ Technical notes on version 2.3 General: +11Sep07 +ebl Fix bug #946 about "bacula-dir -t" witch doesn't works + as expected. 09Sep07 ebl Using "m" in bconsole will show messages like before, and not memory usage. -- 2.39.5