Benjamin,

It's a bug, try the attached patch.

Jean-Louis

Benjamin Boksa wrote:
I'd hate to see too much work go into hacking *around* the script API
-- it's brand new! The best outcome would be to fix/improve the script
API as appropriate, but at the very least, let's make sure that the
limitations of the API are well-documented.  From what I can tell from
this thread:

* per-host scripts can only run on the server
* per-host scripts run for *every* DLE to which they are attached,
which can result in them running several times for a single host; even
in this case, all scripts are run before any hosts are dumped

Regarding fixing the Script API I think I might have found a bug (using Amanda 
2.6.1p1): POST-HOST-BACKUP only seems to get executed once per amdump.


To reproduce this bug I use the following disklist:

mail01.oelstrasse.boksa.de /var/mail {
        default
        script {
                plugin "amlog-script"
                execute-where server
                execute_on pre-host-backup, post-host-backup
                property "logfile" "/tmp/test"
        }
}
www01.oelstrasse.boksa.de /var/www {
        default
        script {
                plugin "amlog-script"
                execute-where server
                execute_on pre-host-backup, post-host-backup
                property "logfile" "/tmp/test"
        }
}


The result (found in /tmp/test) is:

DailySet1 pre-host-backup server www01.oelstrasse.boksa.de /var/www DailySet1 pre-host-backup server mail01.oelstrasse.boksa.de /var/mail DailySet1 post-host-backup server mail01.oelstrasse.boksa.de /var/mail

Obviously there is something wrong.

Is this a known bug? If not: Where should I file it? Are there any known 
workarounds for this bug?

Looking forward to your comments!

Regards

Benjamin

diff --git a/server-src/driver.c b/server-src/driver.c
index c96d0be..28f0e77 100644
--- a/server-src/driver.c
+++ b/server-src/driver.c
@@ -1952,7 +1952,10 @@ handle_dumper_result(
 	    run_server_scripts(EXECUTE_ON_POST_DLE_BACKUP,
 			       get_config_name(), dp, sched(dp)->level);
 	    for (dp1=runq.head; dp1 != NULL; dp1 = dp1->next) {
-		if (dp1 != dp) last_dump = 0;
+		if (dp1->host == dp->host) last_dump = 0;
+	    }
+	    for (dp1=directq.head; dp1 != NULL; dp1 = dp1->next) {
+		if (dp1->host == dp->host) last_dump = 0;
 	    }
 	    if (last_dump && dp->host->post_script == 0) {
 		if (dp->host->post_script == 0) {

Reply via email to