On 12/ 2/15 07:35 PM, Jörg Steffens wrote: > As pointed out in > http://article.gmane.org/gmane.comp.sysutils.backup.bareos.user/2115, > if the database upgrade of postgres fails, the script > src/cats/update_bareos_tables.in > loops forever. > I provoked this bug by writing an older VersionId to the database > (UPDATE version SET versionid=2003;) > > The simple fix for this would be to replace "break" with "exit 1" in > if [ ${retval} != 0 ]; then > echo "Failed to upgrade database schema from version > ${start_version} to ${end_version}" > break; > fi > > However, my question is: is the break there on intension? If you do an > update without the rollback functionality, it might get to a state, > where the next update can be applied. However, I don't think, this is to > useful. If we detect a problem, the update process should stop. The break would also break the while [ 1 ] loop but as there is break; e.g. with a ; it seems the loop keeps on running. As the idea was to break and exit ${retval} I replaced it now with an explicit exit ${retval} then you at least get the return value from the failed sql manipulation command.
-- Marco van Wieringen marco.van.wierin...@bareos.com Bareos GmbH & Co. KG Phone: +49-221-63069389 http://www.bareos.com Sitz der Gesellschaft: Köln | Amtsgericht Köln: HRA 29646 Komplementär: Bareos Verwaltungs-GmbH Geschäftsführer: Stephan Dühr, M. Außendorf, J. Steffens, P. Storz, M. v. Wieringen -- You received this message because you are subscribed to the Google Groups "bareos-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to bareos-devel+unsubscr...@googlegroups.com. To post to this group, send email to bareos-devel@googlegroups.com. For more options, visit https://groups.google.com/d/optout.