static int foreground = 0;
static int inetd_request = 0;
static workq_t dir_workq; /* queue of work from Director */
+static pthread_t server_tid;
static void usage()
init_stack_dump();
my_name_is(argc, argv, "bacula-fd");
- textdomain("bacula-fd");
+ textdomain("bacula");
init_msg(NULL, NULL);
daemon_start_time = time(NULL);
start_watchdog(); /* start watchdog thread */
init_jcr_subsystem(); /* start JCR watchdogs etc. */
+ server_tid = pthread_self();
if (inetd_request) {
/* Socket is on fd 0 */
void terminate_filed(int sig)
{
+ bnet_stop_thread_server(server_tid);
write_state_file(me->working_directory, "bacula-fd", me->FDport);
delete_pid_file(me->pid_directory, "bacula-fd", me->FDport);
if (configfile != NULL) {
term_msg();
stop_watchdog();
close_memory_pool(); /* release free memory in pool */
- sm_dump(False); /* dump orphaned buffers */
- exit(1);
+ sm_dump(false); /* dump orphaned buffers */
+ exit(sig);
}