Bug 39740: (QA follow-up) Adjust debugger for koha-plack and koha-z3950-responder

This patch mainly renames var debug_mode in both scripts when it refers
to the debugger instead of the instance's debug_mode.

Note: Removing $environment from responder, probably copied.

Test plan:
cp debian/scripts/koha-functions.sh /usr/share/koha/bin/
cp debian/scripts/koha-* /usr/sbin/
cp debian/templates/plack.psgi /etc/koha/plack.psgi
Repeat steps from patch: "Replace envvar check by calling..."
Repeat steps from patch: "Adjust koha-plack and koha-z3950-responder"

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Marcel de Rooy 2025-07-30 13:27:58 +02:00 committed by Lucas Gass
parent 0b0eb6bc14
commit 968339b7c9
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
2 changed files with 14 additions and 17 deletions

View File

@ -102,8 +102,8 @@ start_plack()
--error-log /var/log/koha/${instancename}/plack-error.log"
max_requests_and_workers="--max-requests ${PLACK_MAX_REQUESTS} --workers ${PLACK_WORKERS}"
# Enable debug mode in development
if [ "$debug_mode" = "yes" ] && [ "$environment" = "development" ]; then
# Enable debugger?
if [ "$debugger" = "yes" ] && [ "$environment" = "development" ]; then
daemonize=""
logging="" # remote debugger takes care
max_requests_and_workers="--workers 1"
@ -373,10 +373,9 @@ _do_instance() {
if [ "$KOHA_BINDIR" = "misc" ]; then GIT_INSTALL=1; else GIT_INSTALL=""; fi
export PERL5LIB KOHA_HOME GIT_INSTALL
# If debug mode is enabled, add the debugger lib path
# to PERL5LIB if appropriate
#FIXME: many of these variables should be set in a higher scope
if [ "$debug_mode" = "yes" ]; then
# If debugger is enabled, add the debugger lib path to PERL5LIB if appropriate
# FIXME: many of these variables should be set in a higher scope
if [ "$debugger" = "yes" ]; then
if [ "$debugger_path" != "" ]; then
PERL5LIB="${debugger_path}":$PERL5LIB
fi
@ -418,7 +417,7 @@ _do_instance() {
STARMAN=$(which starman)
op=""
quiet="no"
debug_mode="no"
debugger="no"
debugger_key=""
debugger_location="localhost:9000"
debugger_path=""
@ -454,7 +453,7 @@ while [ $# -gt 0 ]; do
set_action "status"
shift ;;
--debugger)
debug_mode="yes"
debugger="yes"
shift ;;
--debugger-key)
debugger_key="$2"

View File

@ -86,13 +86,12 @@ start_z3950()
logging="-l /var/log/koha/${instancename}/z3950.log"
Z3950RESPONDER="/usr/bin/perl $KOHA_HOME/$KOHA_BINDIR/z3950_responder.pl"
if [ "$debug_mode" = "yes" ] && is_debug_mode $instancename; then
environment="development"
if [ "$debugger" = "yes" ] && is_debug_mode $instancename; then
daemonize=""
logging="" # remote debugger takes care
Z3950RESPONDER="/usr/bin/perl -d $KOHA_HOME/$KOHA_BINDIR/z3950_responder.pl"
elif [ "$debug_mode" = "yes" ]; then
warn "Not a test system, disabling debug mode"
elif [ "$debugger" = "yes" ]; then
warn "Not a test system, disabling debugger"
fi
Z3950OPTS="-c ${CONFIGDIR} \
@ -238,7 +237,7 @@ set_action()
op=""
quiet="no"
debug_mode="no"
debugger="no"
debugger_key=""
debugger_location="localhost:9000"
debugger_path=""
@ -268,7 +267,7 @@ while [ $# -gt 0 ]; do
set_action "disable"
shift ;;
--debugger)
debug_mode="yes"
debugger="yes"
shift ;;
--debugger-key)
debugger_key="$2"
@ -296,9 +295,8 @@ if [ $# -gt 0 ]; then
adjust_paths_git_install $name
PERL5LIB=$PERL5LIB:$KOHA_HOME/installer:$KOHA_HOME/lib/installer
# If debug mode is enabled, add the debugger lib path
# to PERL5LIB if appropriate
if [ "$debug_mode" = "yes" ] && is_debug_mode $name; then
# If debugger is enabled, add the debugger lib path to PERL5LIB if appropriate
if [ "$debugger" = "yes" ]; then
if [ "$debugger_path" != "" ]; then
PERL5LIB="${debugger_path}":$PERL5LIB
fi