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:
6 patch -p0 <1.36.1-reload.patch
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
14 int njobs = 0; /* number of running jobs */
19 abort(); /* Oops, recursion -> die */
21 reload_table[table].res_table = save_config_resources();
22 Dmsg1(100, "Saved old config in table %d\n", table);
24 - parse_config(configfile);
25 + ok = parse_config(configfile, 0); /* no exit on error */
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 */
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"));
35 Jmsg(NULL, M_ERROR, 0, _("Please correct configuration file: %s\n"), configfile);
36 + Jmsg(NULL, M_ERROR, 0, _("Resetting previous configuration.\n"));
38 reload_table[rtable].res_table = save_config_resources();
39 /* Now restore old resoure values */
41 job = (JOB *)GetNextRes(R_JOB, NULL);
42 director = (DIRRES *)GetNextRes(R_DIRECTOR, NULL);
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);
50 set_working_directory(director->working_directory);