many others, a complete list can be found in the file AUTHORS.
This program is Free Software; you can redistribute it and/or
modify it under the terms of version two of the GNU General Public
- License as published by the Free Software Foundation plus additions
- that are listed in the file LICENSE.
+ License as published by the Free Software Foundation and included
+ in the file LICENSE.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
Jmsg((JCR *)NULL, M_ERROR_TERM, 0, _("Please correct configuration file: %s\n"), configfile);
}
+ 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));
+ }
+
drop(uid, gid); /* reduce privileges if requested */
if (!check_catalog()) {
FDConnectTimeout = (int)director->FDConnectTimeout;
SDConnectTimeout = (int)director->SDConnectTimeout;
- 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));
-
#if !defined(HAVE_WIN32)
signal(SIGHUP, reload_config);
static bool already_here = false;
if (already_here) { /* avoid recursive temination problems */
+ bmicrosleep(2, 0); /* yield */
exit(1);
}
already_here = true;
generate_daemon_event(NULL, "Exit");
write_state_file(director->working_directory, "bacula-dir", get_first_port_host_order(director->DIRaddrs));
delete_pid_file(director->pid_directory, "bacula-dir", get_first_port_host_order(director->DIRaddrs));
-// signal(SIGCHLD, SIG_IGN); /* don't worry about children now */
term_scheduler();
term_job_server();
if (runjob) {