]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/fd_cmds.c
Make restore job yes/mod/no print in one command so GUI works.
[bacula/bacula] / bacula / src / dird / fd_cmds.c
index ec10a5cdb707e84ec8eabcdd97f0f76e9fe4e15c..0f6ef13500bb35bb1ffc14e5fd997d5f57e931bd 100644 (file)
@@ -79,9 +79,16 @@ int connect_to_file_daemon(JCR *jcr, int retry_interval, int max_retry_time,
 {
    BSOCK   *fd;
    char ed1[30];
+   utime_t heart_beat;
+
+   if (jcr->client->heartbeat_interval) {
+      heart_beat = jcr->client->heartbeat_interval;
+   } else {           
+      heart_beat = director->heartbeat_interval;
+   }
 
    if (!jcr->file_bsock) {
-      fd = bnet_connect(jcr, retry_interval, max_retry_time,
+      fd = bnet_connect(jcr, retry_interval, max_retry_time, heart_beat,
            _("File daemon"), jcr->client->address,
            NULL, jcr->client->FDport, verbose);
       if (fd == NULL) {
@@ -505,6 +512,9 @@ int send_runscript_with_old_proto(JCR *jcr, int when, POOLMEM *msg)
 
 /*
  * Send RunScripts to File daemon
+ * 1) We send all runscript to FD, they can be executed Before, After, or twice
+ * 2) Then, we send a "RunBeforeNow" command to the FD to tell him to do the
+ *    first run_script() call. (ie ClientRunBeforeJob)
  */
 int send_runscripts_commands(JCR *jcr)
 {
@@ -552,15 +562,16 @@ int send_runscripts_commands(JCR *jcr)
                return 0;
             }
          }
+         /* TODO : we have to play with other client */
          /*
            else {
            send command to an other client
            }
          */
       }        
-   }
-   
-   /* TODO : we have to play with other client */
+   } 
+
+   /* We tell to the FD that i can execute commands (ie ClientRunBeforeJob) */
    if (launch_before_cmd) {
       bnet_fsend(fd, runbeforenow);
       if (!response(jcr, fd, OKRunBeforeNow, "RunBeforeNow", DISPLAY_ERROR)) {