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 <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Martin Renvoize 2019-10-15 13:45:13 +01:00
parent 19fbc1cfa2
commit 82abbb29f9
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
1 changed files with 5 additions and 2 deletions

View File

@ -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;