]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/filed/filed.c
Fix reporting jobs from state file + misc
[bacula/bacula] / bacula / src / filed / filed.c
index ffc4648c06669444cfbe984777a61f667bb16763..bd8fd3570449776cec7b62a8a5531f82d1b37be2 100644 (file)
@@ -214,6 +214,7 @@ Without that I don't know who I am :-(\n"), configfile);
 
    /* Maximum 1 daemon at a time */
    create_pid_file(me->pid_directory, "bacula-fd", me->FDport);
+   read_state_file(me->working_directory, "bacula-fd", me->FDport);
 
    drop(uid, gid);
 
@@ -241,7 +242,7 @@ Without that I don't know who I am :-(\n"), configfile);
                      &dir_workq, handle_client_request);
    }
 
-   term_msg();
+   terminate_filed(0);
    exit(0);                          /* should never get here */
 }
 
@@ -253,6 +254,7 @@ void terminate_filed(int sig)
    if (debug_level > 5) {
       print_memory_pool_stats(); 
    }
+   write_state_file(me->working_directory, "bacula-fd", me->FDport);
    delete_pid_file(me->pid_directory, "bacula-fd", me->FDport);
    free_config_resources();
    term_msg();