@@ -, +, @@ You should see lines like Worker processes cleaned up Server closing! Output should be "Starting Plack daemon for kohadev:" And you end back at the interactive shell it should look like: Starman::Server (type Net::Server::PreFork) starting! Binding to UNIX socket file "/var/run/koha/kohadev/plack.sock" Starman: Accepting connections at unix://localhost:/var/run/koha/kohadev/plack.sock/ debian/scripts/koha-plack --start --hot-reload kohadev Starting Plack daemon for kohadev:Watching /kohadevbox/koha/Koha /etc/koha/sites/kohadev/plack.psgi for file updates. daemonized tail -n 4 /var/log/koha/kohadev/plack-error.log Starman::Server (type Net::Server::PreFork) starting! pid(27638) Binding to UNIX socket file "/var/run/koha/kohadev/plack.sock" Starman: Accepting connections at unix://localhost:/var/run/koha/kohadev/plack.sock/ touch Koha/Biblios.pm -- /kohadevbox/koha/Koha/Biblios.pm updated. Killing the existing server Successfully killed! Restarting the new server process. in the shell were you started plack to stop the process. --- debian/scripts/koha-plack | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) --- a/debian/scripts/koha-plack +++ a/debian/scripts/koha-plack @@ -60,6 +60,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 + --hot-reload Enable hot-reload (only in koha-testing-docker) --quiet|-q Make the script quiet about non existent instance names (useful for calling from another scripts). --help|-h Display this help message @@ -95,6 +96,7 @@ start_plack() 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}" + plack_hot_reload="" if [ "$DEV_INSTALL" = "1" ]; then # Maybe we should switch off debug_mode if DEV_INSTALL is not set? @@ -106,12 +108,18 @@ start_plack() daemonize="" logging="" # remote debugger takes care max_requests_and_workers="--workers 1" - STARMAN="/usr/bin/perl -d ${STARMAN}" + PLACKUP="/usr/bin/perl -d ${PLACKUP}" fi - STARMANOPTS="-M FindBin ${max_requests_and_workers} \ + if [ "$hot_reload" = "yes" ] && [ "$KOHA_INSTANCE" = "kohadev" ] && [ -d "/kohadevbox/koha/Koha" ]; then + plack_hot_reload="-R /kohadevbox/koha/Koha"; + daemonize="" + fi + + PLACKUPOPTS="-M FindBin ${max_requests_and_workers} \ + -s Starman --user=${instance_user} --group ${instancename}-koha \ - --pid ${PIDFILE} ${daemonize} ${logging} \ + --pid ${PIDFILE} ${daemonize} ${logging} ${plack_hot_reload}\ -E ${environment} --socket ${PLACKSOCKET} ${PSGIFILE}" if ! is_plack_running ${instancename}; then @@ -123,7 +131,7 @@ start_plack() current_dir=$(pwd) eval cd ~$instance_user - if ${STARMAN} ${STARMANOPTS}; then + if ${PLACKUP} ${PLACKUPOPTS}; then log_end_msg 0 else log_end_msg 1 @@ -398,13 +406,14 @@ _do_instance() { esac } -STARMAN=$(which starman) +PLACKUP=$(which plackup) op="" quiet="no" debug_mode="no" debugger_key="" debugger_location="localhost:9000" debugger_path="" +hot_reload="" # Read command line parameters while [ $# -gt 0 ]; do @@ -445,6 +454,9 @@ while [ $# -gt 0 ]; do --debugger-path) debugger_path="$2" shift 2 ;; + --hot-reload) + hot_reload="yes" + shift ;; -*) die "Error: invalid option switch ($1)" ;; *) --