That is very useful.  You are right; I was assuming a non-attached TTY; 
however, it could very well be a closed/re-directed stdout.  The NetBackup 
client does fun things with stdout/stderr for logging and data transfer.  I 
will run some tests tomorrow to check.  

The scenario is quite simple.  The NetBackup client runs a pre-script on 
backup.  I use this pre-script with dump-able databases (oVirt, MythTV, Unifi, 
etc..) like this to create the backup file, then the backup program scoops up 
the generated file(s), and finally the post script cleans up.  The pre-script 
is just calling:

/usr/bin/engine-backup --mode=backup --file=$outf --log=$outl --scope=all

You are right about output being run earlier, so yes it should have caused 
problems earlier?  I only tested at the very end.  From the code:

do${MODE}
ec="$?"
log "EC: ${ec}"

output "Done."

ec="$?"
log "EC: ${ec}"

The exit code was 0 in the first one, but flipped to 1 after the output line.  
What I didn't test was what it looks like right after the earlier output lines. 
 It could be the case that it gets set to 1, but then gets reset to 0 by the 
actual backup, before anything tests for it again (or it's time to exit).

And I had tried a "2>&1 >/dev/null" wrap before, and tried to run it from cron 
-- none of which I could get to work either.  I will play around some more.

-Edmond
_______________________________________________
Users mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Privacy Statement: https://www.ovirt.org/privacy-policy.html
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/[email protected]/message/YBBIWTAWDALPVYS2TBVEGWHFWPVGM7FB/

Reply via email to