When you run "koha-plack --restart" the output is not well aligned: $ sudo koha-plack --restart kohadev [ ok ] Restarting Plack daemon for kohadev:[....] Stopping Plack daemon for kohadev:. [ ok ] Starting Plack daemon for kohadev:. . ok
It looks like problem is here: 166 log_daemon_msg "Restarting Plack daemon for ${instancename}" 167 168 if stop_plack $instancename && start_plack $instancename; then 169 log_end_msg 0 170 else 171 log_end_msg 1 172 fi We call log_daemon_msg on line 166, then we call the corresponding log_end_msg on lines 169 or 171. But in between we call stop_plack and start_plack, which do their own output through log_daemon_msg/log_end_msg, causing the out of line output. I can see a couple of solutions to this: 1. Call log_daemon_msg inside the if: if stop_plack $instancename && start_plack $instancename; then log_daemon_msg "Restarted Plack daemon for ${instancename}" log_end_msg 0 else log_daemon_msg "Could not restart Plack daemon for ${instancename}" log_end_msg 1 fi This gives output like this: $ sudo koha-plack --restart kohadev [ ok ] Stopping Plack daemon for kohadev:. [ ok ] Starting Plack daemon for kohadev:. [ ok ] Restarted Plack daemon for kohadev:. 2. Don't call log_daemon_msg at all: stop_plack $instancename && start_plack $instancename This gives us: $ sudo koha-plack --restart kohadev [ ok ] Stopping Plack daemon for kohadev:. [ ok ] Starting Plack daemon for kohadev:. stop_plack and start_plack will each tell us what they do and if they succeed or not, so do we really need that third line? I will submit a patch for the second solution, but I'm happy to make a patch for the first solution, if that is the preferred way.
Created attachment 93244 [details] [review] Bug 23700 - Fix output of koha-plack --restart To test: - Run "sudo koha-plack restart kohadev" and verify the output is out of line. - Apply the patch - If you are on e.g. kohadevbox you need to copy koha-plack to /usr/sbin/ thus: sudo cp debian/scripts/koha-plack /usr/sbin/koha-plack - Run "sudo koha-plack restart kohadev" again and check that you get two lines of output, nicely aligned with the "OK" inside the square brackets.
Created attachment 93344 [details] [review] Very nicely aligned now. Bug 23700 - Fix output of koha-plack --restart To test: - Run "sudo koha-plack restart kohadev" and verify the output is out of line. - Apply the patch - If you are on e.g. kohadevbox you need to copy koha-plack to /usr/sbin/ thus: sudo cp debian/scripts/koha-plack /usr/sbin/koha-plack - Run "sudo koha-plack restart kohadev" again and check that you get two lines of output, nicely aligned with the "OK" inside the square brackets. Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
Created attachment 94409 [details] [review] Bug 23700 - Fix output of koha-plack --restart To test: - Run "sudo koha-plack restart kohadev" and verify the output is out of line. - Apply the patch - If you are on e.g. kohadevbox you need to copy koha-plack to /usr/sbin/ thus: sudo cp debian/scripts/koha-plack /usr/sbin/koha-plack - Run "sudo koha-plack restart kohadev" again and check that you get two lines of output, nicely aligned with the "OK" inside the square brackets. Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Nice work! Pushed to master for 19.11.00