     /* Cancel SD */
 -   cancel_storage_daemon_job(jcr);
 -   wait_for_storage_daemon_termination(jcr);
-+   wait_for_job_termination(jcr, 300);
++   wait_for_job_termination(jcr, FDConnectTimeout);
     Dmsg1(400, "after wait for sd. use=%d\n", jcr->use_count());
     return false;
  }

 extern void backup_cleanup(JCR *jcr, int TermCode);
Index: src/filed/job.c
===================================================================
--- src/filed/job.c	(rvision 5856)
+++ src/filed/job.c	(copie de travail)
@@ -269,6 +269,16 @@
    /* Run the after job */
    run_scripts(jcr, jcr->RunScripts, "ClientAfterJob");
 
+   if (jcr->JobId) {
+      char ed1[50], ed2[50];
+      /* Send termination status back to Dir */
+      bnet_fsend(dir, EndJob, jcr->JobStatus, jcr->JobFiles,

Index: src/dird/backup.c
===================================================================
--- src/dird/backup.c	(rvision 6032)
+++ src/dird/backup.c	(copie de travail)
@@ -245,8 +245,7 @@
    set_jcr_job_status(jcr, JS_ErrorTerminated);
