]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Add events when reloading the configuration
authorEric Bollengier <eric@baculasystems.com>
Fri, 10 Sep 2021 10:21:00 +0000 (12:21 +0200)
committerEric Bollengier <eric@baculasystems.com>
Fri, 30 Jun 2023 16:34:59 +0000 (18:34 +0200)
bacula/src/dird/dird.c
bacula/src/dird/ua_cmds.c

index 0ec020e745270c938e6a5e74efbd9203c325912b..e2ab105efb8d7921cd93afc49984fd5633b9edb8 100644 (file)
@@ -758,6 +758,10 @@ void reload_config(int sig)
       /* Now restore old resource pointer */
       res_head = reload_table[table].res_head;
       table = rtable;           /* release new, bad, saved table below */
+      events_send_msg(NULL, "DD0004",
+                      EVENTS_TYPE_DAEMON, "*Director*",
+                      (intptr_t)get_first_port_host_order(director->DIRaddrs), "Error while reloading Director configuration");
+
    } else {
       invalidate_schedules();
 
@@ -778,6 +782,9 @@ void reload_config(int sig)
       }
       endeach_jcr(jcr);
       connect_and_init_globals();
+      events_send_msg(NULL, "DD0005",
+                      EVENTS_TYPE_DAEMON, "*Director*",
+                      (intptr_t)get_first_port_host_order(director->DIRaddrs), "Director configuration reloaded");
    }
 
    /* Reset other globals */
index 224341a4a5d061ad221bf4da37fdafcf9eb6790b..264167b63629b02317f7a48702e0814d20693d95 100644 (file)
@@ -1822,6 +1822,7 @@ extern "C" void reload_config(int sig);
 
 static int reload_cmd(UAContext *ua, const char *cmd)
 {
+   ua->send_events("DC0019", EVENTS_TYPE_COMMAND, "reload");
    reload_config(1);
    return 1;
 }