[Koha] "run_safe_xmlstarlet: command not found" after upgrade to 16.05.19.000

Alex Shepherd kiwi64ajs at gmail.com
Fri Jan 26 09:25:35 NZDT 2018


Hi Marcel & Mason,

Thanks for the assistance to identify the problem.

BTW I’m running Ubuntu 16.04 LTS and installed from packages

lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.3 LTS
Release:	16.04
Codename:	xenial

My local fix for this was:

1) Locate the latest version of koha-functions.sh in Git and copied the missing function run_safe_xmlstarlet
	https://github.com/Koha-Community/Koha/blob/master/debian/scripts/koha-functions.sh <https://github.com/Koha-Community/Koha/blob/master/debian/scripts/koha-functions.sh>

Here is the body of the missing function in case others need to do the same manual patch

run_safe_xmlstarlet()
{
    # When a bash script sets -e (errexit), calling xmlstarlet on an
    # unexisting key would halt the script. This is resolved by calling
    # this function in a subshell. It will always returns true, while not
    # affecting the exec env of the caller. (Otherwise, errexit is cleared.)
    local instancename=$1
    local myexpr=$2
    set +e; # stay on the safe side
    echo $(xmlstarlet sel -t -v "yazgfs/config/$myexpr" /etc/koha/sites/$instancename/koha-conf.xml)
    return 0
}

2) Edited my local copy of koha-functions.sh: 
	sudo vi /usr/share/koha/bin/koha-functions.sh

3) Appended the function run_safe_xmlstarlet to the end of the file and save

4) Re-enabled plack on all instance and restarted the VPS.

This seems to work ok for me in that performance is back to where it was and things seem to be running ok…

HTH

Alex Shepherd

> On 25/01/2018, at 8:39 PM, Marcel de Rooy <M.de.Rooy at rijksmuseum.nl> wrote:
> 
> Mason,
> You are missing something here in 16.05.19.
> git grep run_safe_xmlstarlet
> debian/scripts/koha-plack:    PLACK_MAX_REQUESTS=$(run_safe_xmlstarlet $instancename plack_max_requests)
> debian/scripts/koha-plack:    PLACK_WORKERS=$(run_safe_xmlstarlet $instancename plack_workers)
> The routine should be in koha-functions.sh.
> 
> Marcel
> 
> -----Oorspronkelijk bericht-----
> Van: Marcel de Rooy 
> Verzonden: donderdag 25 januari 2018 08:30
> Aan: koha ml <koha at lists.katipo.co.nz>
> Onderwerp: RE: [Koha] "run_safe_xmlstarlet: command not found" after upgrade to 16.05.19.000
> 
> This is a routine in debian/scripts/koha-functions.sh Make sure that you have the correct koha-functions.sh in the right location (usr/share/koha/bin)
> 
> -----Oorspronkelijk bericht-----
> Van: Koha [mailto:koha-bounces at lists.katipo.co.nz] Namens Alex Shepherd
> Verzonden: woensdag 24 januari 2018 21:27
> Aan: koha at lists.katipo.co.nz
> Onderwerp: [Koha] "run_safe_xmlstarlet: command not found" after upgrade to 16.05.19.000
> 
> Hi Team,
> 
> I’ve just done an upgrade to my koha systems to 16.05.19.000, but after the upgrade I was getting “Service Unavailable” messages.
> 
> I tracked it back to plack not starting.
> 
> For now I’ve disabled plack on all the instances and restarted apache and they’re all working again, but performance will be less…
> 
> Here is the error I see:  
> 
> 	root at koha:/usr/sbin# koha-plack --start  bbs
> 	/usr/sbin/koha-plack: line 77: run_safe_xmlstarlet: command not found
> 
> Any suggestions?
> 
> Regards
> 
> Alex Shepherd
> 
> p: +64-7-829 4441
> m: +64-21-777764
> e: kiwi64ajs at gmail.com
> 
> _______________________________________________
> Koha mailing list  http://koha-community.org Koha at lists.katipo.co.nz https://lists.katipo.co.nz/mailman/listinfo/koha
> _______________________________________________
> Koha mailing list  http://koha-community.org
> Koha at lists.katipo.co.nz
> https://lists.katipo.co.nz/mailman/listinfo/koha



More information about the Koha mailing list