From d4612c6ab9f30be8cc66b33e90e07a9082d34871 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 23 May 2024 06:47:44 +0000 Subject: [PATCH] Bug 36932: Add development parameter to koha-plack Test plan: NOTE: Needs dev_install or ktd. [1] Add a die in a script somewhere to simulate a crash. For example in opac-main.pl: die "Line 43"; [2] Run koha-plack --restart YOUR_CLONE (without -dev) and hit that page. See no dev output? [3] Run koha-plack --restart -dev YOUR_CLONE and hit page again. See dev output? [4] BONUS: Do a koha-plack --reload YOUR_CLONE (without -dev). Hit page. Verify that environment did not change. Signed-off-by: Marcel de Rooy Signed-off-by: David Nind Signed-off-by: Martin Renvoize --- debian/scripts/koha-plack | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/debian/scripts/koha-plack b/debian/scripts/koha-plack index 28f5430c72b..eb3282c0f50 100755 --- a/debian/scripts/koha-plack +++ b/debian/scripts/koha-plack @@ -43,7 +43,7 @@ $scriptname This script lets you manage the plack daemons for your Koha instances. Usage: -$scriptname --start|--stop|--restart|--reload|--status [--quiet|-q] instancename1 [instancename2...] +$scriptname --start|--stop|--restart|--reload|--status|--development [--quiet|-q] instancename1 [instancename2...] $scriptname --enable|--disable instancename1 [instancename2] $scriptname -h|--help @@ -61,6 +61,7 @@ $scriptname -h|--help --debugger-location Specify the host:port for your debugger tool (defaults to localhost:9000) --debugger-path Specify the path for the debugger library + --development|-dev Enable development environment --quiet|-q Make the script quiet about non existent instance names (useful for calling from another scripts). --help|-h Display this help message @@ -91,19 +92,14 @@ start_plack() instance_user="${instancename}-koha" - environment="deployment" + if [ -z "$development_environment" ]; then environment="deployment"; else environment="development"; fi daemonize="--daemonize" logging="--access-log /var/log/koha/${instancename}/plack.log \ --error-log /var/log/koha/${instancename}/plack-error.log" max_requests_and_workers="--max-requests ${PLACK_MAX_REQUESTS} --workers ${PLACK_WORKERS}" - if [ "$DEV_INSTALL" = "1" ]; then - # Maybe we should switch off debug_mode if DEV_INSTALL is not set? - environment="development" - fi - if [ "$debug_mode" = "yes" ]; then - environment="development" + # Maybe we should switch off debug_mode if DEV_INSTALL is not set? daemonize="" logging="" # remote debugger takes care max_requests_and_workers="--workers 1" @@ -465,6 +461,9 @@ while [ $# -gt 0 ]; do --debugger-path) debugger_path="$2" shift 2 ;; + -dev|--development) + development_environment=1 + shift ;; -*) die "Error: invalid option switch ($1)" ;; *) -- 2.48.1