[Bug 30684] New: When Plack is not running koha-plack --restart should warn and then start Plack
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 Bug ID: 30684 Summary: When Plack is not running koha-plack --restart should warn and then start Plack Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: alexbuckley@catalyst.net.nz QA Contact: testopia@bugs.koha-community.org Currently, when Plack is not running, if you run sudo koha-plack --restart {$instancename} you get: "Error: Plack not running for ${instancename}" It would be nice if Koha would warn that Plack is not currently running and then start it, rather than just erroring. -- 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=30684 Alex Buckley <alexbuckley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |trivial Assignee|koha-bugs@lists.koha-commun |alexbuckley@catalyst.net.nz |ity.org | Change sponsored?|--- |Sponsored -- 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=30684 Alex Buckley <alexbuckley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 --- Comment #1 from Alex Buckley <alexbuckley@catalyst.net.nz> --- Created attachment 134622 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=134622&action=edit Bug 30684: When Plack is not running koha-plack --restart should warn and then start Plack Test plan: 1. Stop plack 2. Run: sudo koha-plack --restart {instance} 3. Observe you get the error: "Error: Plack not running for ${instancename}" and that plack is not started 4. Apply patch. 5. If you are using kohadevbox you must copy koha-plack to /usr/sbin/: sudo cp debian/scripts/koha-plack /usr/sbin/koha-plack 6. Run: sudo koha-plack --restart {instance} 7. Confirm you get a warning: "Plack not running for ${instancename}. Starting plack now" and that plack is started Sponsored-by: Catalyst IT -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 Alex Buckley <alexbuckley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- 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=30684 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #2 from David Cook <dcook@prosentient.com.au> --- I'm not 100% sure of the "warn" there but overall I like this idea. The current behaviour for "koha-plack --restart" is pretty annoying... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 David Nind <david@davidnind.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=30684 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #134622|0 |1 is obsolete| | --- Comment #3 from David Nind <david@davidnind.com> --- Created attachment 134665 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=134665&action=edit Bug 30684: When Plack is not running koha-plack --restart should warn and then start Plack Test plan: 1. Stop plack 2. Run: sudo koha-plack --restart {instance} 3. Observe you get the error: "Error: Plack not running for ${instancename}" and that plack is not started 4. Apply patch. 5. If you are using kohadevbox you must copy koha-plack to /usr/sbin/: sudo cp debian/scripts/koha-plack /usr/sbin/koha-plack 6. Run: sudo koha-plack --restart {instance} 7. Confirm you get a warning: "Plack not running for ${instancename}. Starting plack now" and that plack is started Sponsored-by: Catalyst IT Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 --- Comment #4 from Alex Buckley <alexbuckley@catalyst.net.nz> --- Thanks, David C and David N for your interaction with this bug report! I can certainly remove the 'warn' if that's the general consensus -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 --- Comment #5 from David Cook <dcook@prosentient.com.au> --- (In reply to Alex Buckley from comment #4)
I can certainly remove the 'warn' if that's the general consensus
I just took another look at debian/scripts/koha-plack and it looks like we use "warn" elsewhere, so actually just ignore my earlier comment! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 --- Comment #6 from Alex Buckley <alexbuckley@catalyst.net.nz> --- (In reply to David Cook from comment #5)
(In reply to Alex Buckley from comment #4)
I can certainly remove the 'warn' if that's the general consensus
I just took another look at debian/scripts/koha-plack and it looks like we use "warn" elsewhere, so actually just ignore my earlier comment!
Perfect, thanks David! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl Status|Signed Off |Failed QA --- Comment #7 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Not sure if this behavior change has a broader community consensus. Please ask on the mailing list. Note that the error was by design: If you did not start it, you cannot restart it. So restart should stop and start. Other scripts like koha-zebra have the same logic. And this is already for many years. Changing plack only here is inconsistent. Changing it in more places after a long time should have a very good reason. FQA for now -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 --- Comment #8 from David Cook <dcook@prosentient.com.au> --- (In reply to Marcel de Rooy from comment #7)
Note that the error was by design: If you did not start it, you cannot restart it. So restart should stop and start.
That design is inconsistent with how services work in general on Linux systems though, which makes them counter-intuitive for sysadmins. I know I've frequently been frustrated by Koha's koha-* scripts due to how their start/stop/restart is different.
Other scripts like koha-zebra have the same logic. And this is already for many years. Changing plack only here is inconsistent. Changing it in more places after a long time should have a very good reason.
Fair point about it being inconsistent across the scripts though... I think making the koha-* scripts more in line with Linux services is a very good reason though. I'm sure it would spare many sysadmins many headaches... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 --- Comment #9 from David Cook <dcook@prosentient.com.au> --- (In reply to David Cook from comment #8)
I think making the koha-* scripts more in line with Linux services is a very good reason though. I'm sure it would spare many sysadmins many headaches...
Especially when used in automation -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|When Plack is not running |koha-* scripts --restart |koha-plack --restart should |should start even when not |warn and then start Plack |running --- Comment #10 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to David Cook from comment #8)
I think making the koha-* scripts more in line with Linux services is a very good reason though. I'm sure it would spare many sysadmins many headaches...
Sounds like a good reason. Will change title and hope for some additional patches. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|trivial |enhancement -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 Alex Buckley <alexbuckley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |ASSIGNED --- Comment #11 from Alex Buckley <alexbuckley@catalyst.net.nz> --- (In reply to Marcel de Rooy from comment #10)
(In reply to David Cook from comment #8)
I think making the koha-* scripts more in line with Linux services is a very good reason though. I'm sure it would spare many sysadmins many headaches...
Sounds like a good reason. Will change title and hope for some additional patches.
Thanks for your thoughts Marcel and David. Please correct me if I'm misunderstanding, but I should amend the files below, making the restart function in each stop and then start the service? - koha-indexer - koha-sip - koha-worker - koha-z3950-responder - koha-zebra Also, do you think I should still write to the mailing list to see if there is a broader community consensus, or just proceed with the above? Thanks, Alex -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 --- Comment #12 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Alex Buckley from comment #11)
Please correct me if I'm misunderstanding, but I should amend the files below, making the restart function in each stop and then start the service?
- koha-indexer - koha-sip - koha-worker - koha-z3950-responder - koha-zebra
Yes, please.
Also, do you think I should still write to the mailing list to see if there is a broader community consensus, or just proceed with the above?
I would say that it does not hurt to do so. It might even trigger a quick signoff. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 --- Comment #13 from Alex Buckley <alexbuckley@catalyst.net.nz> --- (In reply to Marcel de Rooy from comment #12)
(In reply to Alex Buckley from comment #11)
Please correct me if I'm misunderstanding, but I should amend the files below, making the restart function in each stop and then start the service?
- koha-indexer - koha-sip - koha-worker - koha-z3950-responder - koha-zebra
Yes, please.
Also, do you think I should still write to the mailing list to see if there is a broader community consensus, or just proceed with the above?
I would say that it does not hurt to do so. It might even trigger a quick signoff.
Sure thing, thanks Marcel! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 --- Comment #14 from Alex Buckley <alexbuckley@catalyst.net.nz> --- I've written to the Koha community dev mailing list, to check if there is broader community consensus for this change. I'll also work on making those changes to the koha-* scripts with the aim of attaching the patches next week. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |21366 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21366 [Bug 21366] add plack reload -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 Alex Buckley <alexbuckley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #134665|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=30684 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|21366 | See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=21366 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21366 [Bug 21366] add plack reload -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 --- Comment #15 from Alex Buckley <alexbuckley@catalyst.net.nz> --- Created attachment 135747 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135747&action=edit Bug 30684: When a service isn't running koha-* scripts --restart should start it Test plan: 1. Stop plack, indexer, sip, worker, z3950 and zebra. Note: To test Z39.50 restarting you will need to setup the server: https://wiki.koha-community.org/wiki/Setting_up_the_Z39.50_and_SRU_Server#Se... 2. Run restart command for each service: - [Plack] sudo koha-plack --restart {instance} - [Indexer] sudo koha-indexer --restart {instance} - [SIP] sudo koha-sip --restart {instance} - [Worker] sudo koha-worker --restart {instance} - [z3950] sudo koha-z3950-responder --restart {instance} - [Zebra] sudo koha-zebra --restart {instance} 3. Observe the services do not get restarted. Instead you get an error saying the service is not running 4. Apply patch 5. If you are using kohadevbox you must copy koha-* scripts to /usr/sbin/: sudo cp debian/scripts/koha-plack /usr/sbin/koha-plack sudo cp debian/scripts/koha-indexer /usr/sbin/koha-indexer sudo cp debian/scripts/koha-sip /usr/sbin/koha-sip sudo cp debian/scripts/koha-worker /usr/sbin/koha-worker sudo cp debian/scripts/koha-z3950-responder /usr/sbin/koha-z3950-responder sudo cp debian/scripts/koha-zebra /usr/sbin/koha-zebra 6. Repeat step 2 7. This time confirm that each service is restarted Sponsored-by: Catalyst IT -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 Alex Buckley <alexbuckley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff --- Comment #16 from Alex Buckley <alexbuckley@catalyst.net.nz> --- Hi Marcel and David, Apologies it seems I was overly optimistic about when I could get back to this bug report. Thank you David for replying to my request for comment email to the community mailing list! I have been working on this patchset this evening and I tried to add the following line to the else block of restart_plack() in debian/scripts/koha-plack: stop_plack $instancename && start_plack $instancename I found that when plack is not running if I tried koha-plack --restart I would get the following error from that above line: [FAIL] Error: Plack not running for kohadev: failed! I had a discussion with Chris C about this and we concluded that you cannot stop a service that is not running. You will only get an error that the service is not running. Looking at how Apache does it we thought it would be best for the restart functions in the koha-* scripts to check if the service is running and if not then only start the service, not try to stop then start. Our proposed functionality is contained in the attached patchset for all the koha-* scripts with restart functions. Can you please let me know your thoughts when you have a chance? Thanks, Alex -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 --- Comment #17 from David Cook <dcook@prosentient.com.au> --- (In reply to Alex Buckley from comment #16)
Looking at how Apache does it we thought it would be best for the restart functions in the koha-* scripts to check if the service is running and if not then only start the service, not try to stop then start.
Our proposed functionality is contained in the attached patchset for all the koha-* scripts with restart functions.
Can you please let me know your thoughts when you have a chance?
Thanks, Alex
Sounds good to me. Easy to get the Starman PID to see if it's running. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 --- Comment #18 from Alex Buckley <alexbuckley@catalyst.net.nz> --- (In reply to David Cook from comment #17)
(In reply to Alex Buckley from comment #16)
Looking at how Apache does it we thought it would be best for the restart functions in the koha-* scripts to check if the service is running and if not then only start the service, not try to stop then start.
Our proposed functionality is contained in the attached patchset for all the koha-* scripts with restart functions.
Can you please let me know your thoughts when you have a chance?
Thanks, Alex
Sounds good to me. Easy to get the Starman PID to see if it's running.
Thanks David! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 David Nind <david@davidnind.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=30684 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #135747|0 |1 is obsolete| | --- Comment #19 from David Nind <david@davidnind.com> --- Created attachment 137738 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=137738&action=edit Bug 30684: When a service isn't running koha-* scripts --restart should start it Test plan: 1. Stop plack, indexer, sip, worker, z3950 and zebra. Note: To test Z39.50 restarting you will need to setup the server: https://wiki.koha-community.org/wiki/Setting_up_the_Z39.50_and_SRU_Server#Se... 2. Run restart command for each service: - [Plack] sudo koha-plack --restart {instance} - [Indexer] sudo koha-indexer --restart {instance} - [SIP] sudo koha-sip --restart {instance} - [Worker] sudo koha-worker --restart {instance} - [z3950] sudo koha-z3950-responder --restart {instance} - [Zebra] sudo koha-zebra --restart {instance} 3. Observe the services do not get restarted. Instead you get an error saying the service is not running 4. Apply patch 5. If you are using kohadevbox you must copy koha-* scripts to /usr/sbin/: sudo cp debian/scripts/koha-plack /usr/sbin/koha-plack sudo cp debian/scripts/koha-indexer /usr/sbin/koha-indexer sudo cp debian/scripts/koha-sip /usr/sbin/koha-sip sudo cp debian/scripts/koha-worker /usr/sbin/koha-worker sudo cp debian/scripts/koha-z3950-responder /usr/sbin/koha-z3950-responder sudo cp debian/scripts/koha-zebra /usr/sbin/koha-zebra 6. Repeat step 2 7. This time confirm that each service is restarted Sponsored-by: Catalyst IT Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #20 from David Nind <david@davidnind.com> --- Testing notes (using koha-testing-docker): 1. Not related to this bug, but for koha-sip and koha-zebra there is no error message before and after the patch is applied. (All the other scripts say "Error: X not running for {instancename}: failed!".) 2. For koha-testing-docker, need to copy scripts as per step 5. 3. Format of the message after the patch is applied, examples: - Plack not running for kohadev.:Starting Plack daemon for kohadev:. - Worker not running for kohadev (default).:Starting Koha worker daemon for kohadev (default):. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This enhancement restarts release notes| |services if they are not | |running when using the | |--restart option for | |koha-plack, koha-indexer, | |koha-sip, koha-worker, | |koha-z3950-responder, and | |koha-zebra . Before this, | |if a service was not | |running an error message | |was generated (Error: | |{servicename} not running | |for ${instancename}") and a | |start command for the | |service was required. | | | |Example of message if plack | |is not running and the | |service is restarted: | | | |koha-plack --restart | |kohadev | | Plack not running | |for kohadev.:Starting Plack | |daemon for kohadev:. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=24991 --- Comment #21 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- I think you should have a look at the different things raised on bug 24991. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 --- Comment #22 from Alex Buckley <alexbuckley@catalyst.net.nz> --- (In reply to Jonathan Druart from comment #21)
I think you should have a look at the different things raised on bug 24991.
Thanks Jonathan, I'll take a look. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 --- Comment #23 from Alex Buckley <alexbuckley@catalyst.net.nz> --- (In reply to Jonathan Druart from comment #21)
I think you should have a look at the different things raised on bug 24991.
Hi Jonathan, I've taken a look at bug 24991. My patch is a bit different to Liz's as I'm attempting to implement consistent restart logic to all the koha-* scripts. Also, I'm not checking after the else statement whether SIP is running - so am avoiding the problem Marcel noted in https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24991#c9 Would you mind please clarifying for me if you have any particular points in bug 24991 that you think I should implement in my patchset? Kind regards, Alex -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 --- Comment #24 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Ok go with your patch first then. Two things however: 1. koha-sip (at least, but maybe others) is missing \n in the output for restart if stopped (see second patch from bug 24991) $ koha-sip --verbose --stop kohadev Stopping SIP server for kohadev:. $ koha-sip --verbose --restart kohadev Warning: SIP server not running for kohadev.:Starting SIP server for kohadev:. 2. in koha-zebra if [ "$verbose" != "no" ]; then - log_daemon_msg "Error: Zebra not running for ${name}" - log_end_msg 1 + log_daemon_msg "Zebra not running for ${name}." + start_zebra ${name} else + start_zebra ${name} return 1 fi returning 1 here is wrong. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 --- Comment #25 from Alex Buckley <alexbuckley@catalyst.net.nz> --- (In reply to Jonathan Druart from comment #24)
Ok go with your patch first then.
Two things however: 1. koha-sip (at least, but maybe others) is missing \n in the output for restart if stopped (see second patch from bug 24991)
$ koha-sip --verbose --stop kohadev Stopping SIP server for kohadev:. $ koha-sip --verbose --restart kohadev Warning: SIP server not running for kohadev.:Starting SIP server for kohadev:.
2. in koha-zebra if [ "$verbose" != "no" ]; then - log_daemon_msg "Error: Zebra not running for ${name}" - log_end_msg 1 + log_daemon_msg "Zebra not running for ${name}." + start_zebra ${name} else + start_zebra ${name} return 1 fi
returning 1 here is wrong.
Thanks, Jonathan. Working on fixing those two issues up! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 --- Comment #26 from Alex Buckley <alexbuckley@catalyst.net.nz> --- Created attachment 139247 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139247&action=edit Bug 30684: (follow up) Split restart output across multiple lines Also, return 0 rather than return 1 in else clause of koha-zebra Sponsored-by: Catalyst IT, New Zealand -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 --- Comment #27 from Alex Buckley <alexbuckley@catalyst.net.nz> --- (In reply to Alex Buckley from comment #25)
(In reply to Jonathan Druart from comment #24)
Ok go with your patch first then.
Two things however: 1. koha-sip (at least, but maybe others) is missing \n in the output for restart if stopped (see second patch from bug 24991)
$ koha-sip --verbose --stop kohadev Stopping SIP server for kohadev:. $ koha-sip --verbose --restart kohadev Warning: SIP server not running for kohadev.:Starting SIP server for kohadev:.
2. in koha-zebra if [ "$verbose" != "no" ]; then - log_daemon_msg "Error: Zebra not running for ${name}" - log_end_msg 1 + log_daemon_msg "Zebra not running for ${name}." + start_zebra ${name} else + start_zebra ${name} return 1 fi
returning 1 here is wrong.
Thanks, Jonathan. Working on fixing those two issues up!
I've attached a patch hopefully fixing up those two issues. Please let me know if any other changes should be made? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 --- Comment #28 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Why did you replace log_daemon_msg with echo? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 --- Comment #29 from Alex Buckley <alexbuckley@catalyst.net.nz> --- (In reply to Jonathan Druart from comment #28)
Why did you replace log_daemon_msg with echo?
My apologies Jonathan. I replaced log_daemon_msg with echo because I went through all 6 scripts and found it wasn't just koha-sip where the output was not split over multiple lines. For example, with only the first patch applied (i.e. log_daemon_msg being used) koha-plack gives this output: vagrant@kohadevbox:kohaclone((0e08cf28f57...))$ sudo koha-plack --restart kohadev [ ok ] Plack not running for kohadev.:[....] Starting Plack daemon for kohadev:. --- With the second patch applied (i.e. echo being used) the koha-plack gives this output correctly split over two lines: vagrant@kohadevbox:scripts((69bb9e5e337...))$ sudo koha-plack --restart kohadev Plack not running for kohadev. [ ok ] Starting Plack daemon for kohadev:. --- I attempted keeping log_daemon_msg, and adding a newline character \n to the end (log_daemon_msg "Plack not running for ${instancename}.\n"), however, the newline character was not interpreted correctly, see below: vagrant@kohadevbox:kohaclone((69bb9e5e337...))$ sudo koha-plack --restart kohadev [ ok ] Plack not running for kohadev.\n:[....] Starting Plack daemon for kohadev:. Likely, there is some way for the \n character to be correctly interpreted by log_daemon_msg, I could not find how though - do you know how to do that? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 --- Comment #30 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Alex, try 'log_warning_msg' for the "not running" warning. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 Alex Buckley <alexbuckley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #139247|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=30684 --- Comment #31 from Alex Buckley <alexbuckley@catalyst.net.nz> --- Created attachment 139305 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139305&action=edit Bug 30684: (follow-up) Use log_warning_msg for the "not running" warning Also, return 0 rather than return 1 in else clause of koha-zebra Sponsored-by: Catalyst IT, New Zealand -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 Alex Buckley <alexbuckley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the|This enhancement restarts |This enhancement restarts release notes|services if they are not |services if they are not |running when using the |running when using the |--restart option for |--restart option for |koha-plack, koha-indexer, |koha-plack, koha-indexer, |koha-sip, koha-worker, |koha-sip, koha-worker, |koha-z3950-responder, and |koha-z3950-responder, and |koha-zebra . Before this, |koha-zebra . |if a service was not | |running an error message |An example |was generated (Error: |of a message if plack is |{servicename} not running |not running and the service |for ${instancename}") and a |is restarted: |start command for the |koha-plack |service was required. |--restart kohadev | |[warn] |Example of message if plack |Plack not running for |is not running and the |kohadev. ... (warning). |service is restarted: |[ | |ok ] Starting Plack daemon |koha-plack --restart |for kohadev:. |kohadev | | Plack not running |Previously |for kohadev.:Starting Plack |if a service was not |daemon for kohadev:. |running an error message | |was generated (Error: | |{servicename} not running | |for ${instancename}") and a | |start command for the | |service was required. --- Comment #32 from Alex Buckley <alexbuckley@catalyst.net.nz> --- (In reply to Jonathan Druart from comment #30)
Alex, try 'log_warning_msg' for the "not running" warning.
Thanks Jonathan. Is that follow-up any better now? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 Jonathan Druart <jonathan.druart+koha@gmail.com> 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=30684 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #137738|0 |1 is obsolete| | Attachment #139305|0 |1 is obsolete| | --- Comment #33 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 139345 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139345&action=edit Bug 30684: When a service isn't running koha-* scripts --restart should start it Test plan: 1. Stop plack, indexer, sip, worker, z3950 and zebra. Note: To test Z39.50 restarting you will need to setup the server: https://wiki.koha-community.org/wiki/Setting_up_the_Z39.50_and_SRU_Server#Se... 2. Run restart command for each service: - [Plack] sudo koha-plack --restart {instance} - [Indexer] sudo koha-indexer --restart {instance} - [SIP] sudo koha-sip --restart {instance} - [Worker] sudo koha-worker --restart {instance} - [z3950] sudo koha-z3950-responder --restart {instance} - [Zebra] sudo koha-zebra --restart {instance} 3. Observe the services do not get restarted. Instead you get an error saying the service is not running 4. Apply patch 5. If you are using kohadevbox you must copy koha-* scripts to /usr/sbin/: sudo cp debian/scripts/koha-plack /usr/sbin/koha-plack sudo cp debian/scripts/koha-indexer /usr/sbin/koha-indexer sudo cp debian/scripts/koha-sip /usr/sbin/koha-sip sudo cp debian/scripts/koha-worker /usr/sbin/koha-worker sudo cp debian/scripts/koha-z3950-responder /usr/sbin/koha-z3950-responder sudo cp debian/scripts/koha-zebra /usr/sbin/koha-zebra 6. Repeat step 2 7. This time confirm that each service is restarted Sponsored-by: Catalyst IT Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 --- Comment #34 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 139346 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139346&action=edit Bug 30684: (follow-up) Use log_warning_msg for the "not running" warning Also, return 0 rather than return 1 in else clause of koha-zebra Sponsored-by: Catalyst IT, New Zealand Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wizzyrea@gmail.com --- Comment #35 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- *** Bug 24991 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |22.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 --- Comment #36 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 22.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 --- Comment #37 from Alex Buckley <alexbuckley@catalyst.net.nz> --- Thank you for your assistance Jonathan! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Status|Pushed to master |RESOLVED Resolution|--- |FIXED --- Comment #38 from Lucas Gass <lucas@bywatersolutions.com> --- Enhancement will not be backported to 22.05.x for 22.05.06 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30684 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|Architecture, internals, |Command-line Utilities |and plumbing | CC| |robin@catalyst.net.nz -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org