Bugzilla – Attachment 182703 Details for
Bug 31124
koha-remove fails to remove long_tasks queue daemon, so koha-create for same <instance> user fails
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31124: Make koha-remove stop all workers
Bug-31124-Make-koha-remove-stop-all-workers.patch (text/plain), 2.35 KB, created by
Tomás Cohen Arazi (tcohen)
on 2025-05-21 19:35:58 UTC
(
hide
)
Description:
Bug 31124: Make koha-remove stop all workers
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2025-05-21 19:35:58 UTC
Size:
2.35 KB
patch
obsolete
>From b0aef41267e878ab9a47fd9c0572eeb9630bbf84 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 21 May 2025 16:26:31 -0300 >Subject: [PATCH] Bug 31124: Make koha-remove stop all workers > >This patch makes two things: > >* Adds a `get_worker_queues` function to koha-functions.sh >* Makes `koha-remove` loop through all the defined queues to stop all > the running workers before trying to remove the unix user for the > instance. > >To test: >1. Run: > $ ktd --shell > k$ sudo -s > k$ koha-create --create-db test1 > k$ service koha-common restart > k$ koha-remove test1 >=> FAIL: There's an error about not being able to drop the instance user >2. Run: > k$ ps -ef | grep test1 >=> FAIL: There's a running process for the 'long_tasks' queue worker. >3. Apply this patch >4. Run: > k$ cp debian/scripts/koha-functions.sh \ > /usr/share/koha/bin/koha-functions.sh >5. Repeat 1 naming the instance `test2` >=> SUCCESS: The instance is removed correctly. No error about running >processes >=> SUCCESS: No process is running for `test2` >6. Sign off :-D >--- > debian/scripts/koha-functions.sh | 7 +++++++ > debian/scripts/koha-remove | 10 ++++++---- > 2 files changed, 13 insertions(+), 4 deletions(-) > >diff --git a/debian/scripts/koha-functions.sh b/debian/scripts/koha-functions.sh >index b31b1c67909..90ccf1611e0 100755 >--- a/debian/scripts/koha-functions.sh >+++ b/debian/scripts/koha-functions.sh >@@ -242,6 +242,13 @@ get_worker_name() > fi > } > >+get_worker_queues() >+{ >+ for queue in default long_tasks; do >+ echo $queue >+ done; >+} >+ > is_plack_enabled_opac() > { > local instancefile=$1 >diff --git a/debian/scripts/koha-remove b/debian/scripts/koha-remove >index a6653e02f82..96eff08d4c6 100755 >--- a/debian/scripts/koha-remove >+++ b/debian/scripts/koha-remove >@@ -81,10 +81,12 @@ eof > if is_indexer_running $name; then > koha-indexer --stop $name || /bin/true > fi >- # Stop the worker daemon if needed >- if is_worker_running $name; then >- koha-worker --stop $name || /bin/true >- fi >+ # Stop the worker daemons if needed >+ for queue in $(get_worker_queues); do >+ if is_worker_running $name $queue; then >+ koha-worker --queue $queue --stop $name|| /bin/true >+ fi >+ done > # Stop the Plack server if needed > if is_plack_running $name; then > koha-plack --stop $name || /bin/true >-- >2.49.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 31124
:
182702
|
182703
|
182714
|
183054