]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/dird.c
ebl fix #946 about config test mode which was broken.
[bacula/bacula] / bacula / src / dird / dird.c
index d34acd8efbbc1cb7b69033d8606160c9db3d88c7..2b30c065c56ad5418703b5694ff829f14bbfcdee 100644 (file)
@@ -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()) {