https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44314 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|koha-sitemap always exits |koha-sitemap stops at the |0, even when sitemap |first failure (or |generation fails |non-enabled instance with | |--quiet) and doesn't report | |errors Depends on| |44315 --- Comment #1 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Correction to the description: the actual behaviour on main is different from "always exits 0". 1. misc/cronjobs/sitemap.pl itself exits with status 0 when it fails (Koha::Sitemapper calls exit), so koha-sitemap never sees the failure. That is now bug 44315, which this bug depends on. 2. koha-sitemap runs with 'set -e', so the first generate_sitemap call returning non-zero ends the script, and the remaining instances are not processed. This also happens, with exit status 1, for instances that don't have sitemap generation enabled when --quiet is used (the function ends with '[ "$quiet" = "no" ] && warn ...', which returns 1). So koha-sitemap --quiet --generate $(koha-list --enabled) stops at the first instance without sitemaps enabled. The patch makes koha-sitemap: * treat instances without sitemap generation enabled as not an error (exit 0) * keep processing the remaining instances when generation fails for one, and exit 1 at the end if any failed * report each failure on stderr, also with --quiet * document the exit status in the man page Tested in KTD: not enabled (exit 0, silent with --quiet), success (exit 0), forced failure listing the instance twice (both processed, error reported twice, exit 1, also with --quiet), no instance names (exit 0). Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44315 [Bug 44315] Koha::Sitemapper exits with status 0 on errors -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.