From 82abbb29f9b660533966b358554d854cc157f4b9 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 15 Oct 2019 13:45:13 +0100 Subject: [PATCH] Bug 13937: (RM follow-up) Set working directory for daemon mode. When running as a daemon under Net::Z3950::SimpleServer YAZ requires a little help to know where it's "working directory" is located so relative paths in config files may resolve correctly. This patch passes the working directory as prescribed on https://software.indexdata.com/yaz/doc/server.invocation.html such that the resolution of the cql2rpn filepath works as expected in tests. Signed-off-by: Martin Renvoize --- Koha/Z3950Responder.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Koha/Z3950Responder.pm b/Koha/Z3950Responder.pm index 93d0ac2e33..fe335c5b26 100644 --- a/Koha/Z3950Responder.pm +++ b/Koha/Z3950Responder.pm @@ -99,8 +99,11 @@ sub new { unshift @{ $self->{yaz_options} }, '-v', 'none,fatal'; } - # Set main config for SRU support - unshift @{ $self->{yaz_options} }, '-f', $self->{config_dir} . 'config.xml' if $self->{config_dir}; + # Set main config for SRU support and working directory + if ( $self->{config_dir} ) { + unshift @{ $self->{yaz_options} }, '-f', $self->{config_dir} . 'config.xml'; + unshift @{ $self->{yaz_options} }, '-w', $self->{config_dir}; + } # Set num to prefetch if not passed $self->{num_to_prefetch} //= 20; -- 2.20.1