[Bug 23700] New: Fix output of koha-plack --restart
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23700 Bug ID: 23700 Summary: Fix output of koha-plack --restart Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Packaging Assignee: koha-bugs@lists.koha-community.org Reporter: magnus@libriotech.no QA Contact: testopia@bugs.koha-community.org CC: mirko@abunchofthings.net 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 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23700 --- Comment #1 from Magnus Enger <magnus@libriotech.no> --- 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. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23700 Magnus Enger <magnus@libriotech.no> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |magnus@libriotech.no |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23700 Magnus Enger <magnus@libriotech.no> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23700 --- Comment #2 from Magnus Enger <magnus@libriotech.no> --- Created attachment 93244 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=93244&action=edit 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. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23700 Jesse Maseto <jesse@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23700 Jesse Maseto <jesse@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #93244|0 |1 is obsolete| | --- Comment #3 from Jesse Maseto <jesse@bywatersolutions.com> --- Created attachment 93344 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=93344&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23700 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23700 --- Comment #4 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 94409 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=94409&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23700 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl Attachment #93344|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23700 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23700 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |19.11.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23700 --- Comment #5 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice work! Pushed to master for 19.11.00 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org