]> git.sur5r.net Git - bacula/bacula/blob - bacula/patches/1.36.1/1.36.1-reload.patch
Add new free_tls() entry point so that Win32 builds.
[bacula/bacula] / bacula / patches / 1.36.1 / 1.36.1-reload.patch
1  This patch fixes Bacula so that it does not exit if there
2  is a syntax error in its conf file during a reload command.
3  Apply the patch to 1.36.1 with:
4  
5  cd <bacula-source>
6  patch -p0 <1.36.1-reload.patch
7  make
8  make install
9
10 --- ../branch-1.36.1/src/dird/dird.c    2004-11-11 18:30:32.000000000 +0100
11 +++ src/dird/dird.c     2004-12-21 18:15:10.625754501 +0100
12 @@ -372,6 +375,7 @@
13     JCR *jcr;
14     int njobs = 0;                    /* number of running jobs */
15     int table, rtable;
16 +   bool ok;      
17  
18     if (already_here) {
19        abort();                       /* Oops, recursion -> die */
20 @@ -396,16 +400,17 @@
21     reload_table[table].res_table = save_config_resources();
22     Dmsg1(100, "Saved old config in table %d\n", table);
23  
24 -   parse_config(configfile);
25 +   ok = parse_config(configfile, 0);  /* no exit on error */
26  
27     Dmsg0(100, "Reloaded config file\n");
28 -   if (!check_resources()) {
29 +   if (!ok || !check_resources()) {
30        rtable = find_free_reload_table_entry();   /* save new, bad table */
31        if (rtable < 0) {
32           Jmsg(NULL, M_ERROR, 0, _("Please correct configuration file: %s\n"), configfile);
33           Jmsg(NULL, M_ERROR_TERM, 0, _("Out of reload table entries. Giving up.\n"));
34        } else {
35           Jmsg(NULL, M_ERROR, 0, _("Please correct configuration file: %s\n"), configfile);
36 +         Jmsg(NULL, M_ERROR, 0, _("Resetting previous configuration.\n"));
37        }
38        reload_table[rtable].res_table = save_config_resources();
39        /* Now restore old resoure values */
40 @@ -465,8 +470,8 @@
41     job = (JOB *)GetNextRes(R_JOB, NULL);
42     director = (DIRRES *)GetNextRes(R_DIRECTOR, NULL);
43     if (!director) {
44 -      Jmsg(NULL, M_FATAL, 0, _("No Director resource defined in %s\n\
45 -Without that I don't know who I am :-(\n"), configfile);
46 +      Jmsg(NULL, M_FATAL, 0, _("No Director resource defined in %s\n"
47 +"Without that I don't know who I am :-(\n"), configfile);
48        OK = false;
49     } else {
50        set_working_directory(director->working_directory);