From 3b5332934a80cf679a54dbdfeaa4996afb961bcb Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Mon, 12 Feb 2007 19:52:58 +0000 Subject: [PATCH] ebl fix runscript : they was run before the real end of job git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4172 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/filed/job.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/bacula/src/filed/job.c b/bacula/src/filed/job.c index 50ca4cf320..5c8d4c55c1 100644 --- a/bacula/src/filed/job.c +++ b/bacula/src/filed/job.c @@ -244,16 +244,14 @@ void *handle_client_request(void *dirp) } } - if (!jcr->runscript_after) { - jcr->runscript_after=1; - run_scripts(jcr, jcr->RunScripts, "ClientAfterJob"); - } - /* Inform Storage daemon that we are done */ if (jcr->store_bsock) { bnet_sig(jcr->store_bsock, BNET_TERMINATE); } + /* run after job */ + run_scripts(jcr, jcr->RunScripts, "ClientAfterJob"); + generate_daemon_event(jcr, "JobEnd"); dequeue_messages(jcr); /* send any queued messages */ @@ -1389,17 +1387,9 @@ static int backup_cmd(JCR *jcr) bnet_suppress_error_messages(sd, 1); bget_msg(sd); /* Read final response from append_data */ Dmsg0(110, "Error in blast_data.\n"); - /* run shortly after end of data transmission */ - run_scripts(jcr, jcr->RunScripts, "ClientAfterJob"); - jcr->runscript_after=1; - } else { set_jcr_job_status(jcr, JS_Terminated); - /* run shortly after end of data transmission */ - run_scripts(jcr, jcr->RunScripts, "ClientAfterJob"); - jcr->runscript_after=1; - if (jcr->JobStatus != JS_Terminated) { bnet_suppress_error_messages(sd, 1); goto cleanup; /* bail out now */ -- 2.39.5