]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Fix #7164 About Director reload issue with missing Job's directive
authorEric Bollengier <eric@baculasystems.com>
Mon, 28 Dec 2020 15:59:56 +0000 (16:59 +0100)
committerEric Bollengier <eric@baculasystems.com>
Thu, 24 Mar 2022 08:02:59 +0000 (09:02 +0100)
Description:
-----------

When a required directive is removed (like the FileSet directive from the Job resource)
and the reload command is issued, the Director process is doing a M_ERROR_TERM.

  10-Dec 14:31 zog8-dir ERROR TERMINATION
    "Fileset" directive in Job "BackupClient1" resource is required, but not found.

Workaround:
-----------

Use bacula-dir -t or breload to validate the configuration before the reload.

bacula/src/dird/dird.c

index c54d4f8cc4a6ed53b17c6da0bf79d68ddfd47691..557edeaa608944316a0bf74d9945738e398e53b7 100644 (file)
@@ -1137,14 +1137,15 @@ static bool check_resources()
       for (i=0; job_items[i].name; i++) {
          if (job_items[i].flags & ITEM_REQUIRED) {
                if (!bit_is_set(i, job->hdr.item_present)) {
-                  Jmsg(NULL, M_ERROR_TERM, 0, _("\"%s\" directive in Job \"%s\" resource is required, but not found.\n"),
+                  Jmsg(NULL, M_FATAL, 0, _("\"%s\" directive in Job \"%s\" resource is required, but not found.\n"),
                     job_items[i].name, job->name());
                   OK = false;
                 }
          }
          /* If this triggers, take a look at lib/parse_conf.h */
          if (i >= MAX_RES_ITEMS) {
-            Emsg0(M_ERROR_TERM, 0, _("Too many items in Job resource\n"));
+            Jmsg(NULL, M_FATAL, 0, _("Too many items in Job resource\n"));
+            OK = false;
          }
       }
       if (!job->storage && !job->pool->storage) {