Bug 39961

Summary: koha-create doesn't start all queues
Product: Koha Reporter: Tomás Cohen Arazi (tcohen) <tomascohen>
Component: Command-line UtilitiesAssignee: Tomás Cohen Arazi (tcohen) <tomascohen>
Status: Pushed to stable --- QA Contact: Marcel de Rooy <m.de.rooy>
Severity: minor    
Priority: P5 - low CC: david, m.de.rooy, mtj, robin, tomascohen
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: Trivial patch Documentation contact:
Documentation submission: Text to go in the release notes:
This fixes the koha-create and koha-disable package commands so that they start and stop all the background job worker queues (including long_tasks).
Version(s) released in:
25.11.00,25.05.01
Circulation function:
Bug Depends on: 31124    
Bug Blocks:    
Attachments: Bug 39961: Make `koha-create` start all queues
Bug 39961: (follow-up) Make stop all queues
Bug 39961: (follow-up) Make `koha-disable` stop all queues
Bug 39961: Make `koha-create` start all queues
Bug 39961: (follow-up) Make `koha-disable` stop all queues
Bug 39961: Make `koha-create` start all queues
Bug 39961: (follow-up) Make `koha-disable` stop all queues

Description Tomás Cohen Arazi (tcohen) 2025-05-21 19:37:38 UTC
To reproduce:
1. Run:
   $ ktd --shell
  k$ sudo koha-create --create-db test
=> FAIL: No mention to `long_tasks`:
```
Koha instance is empty, no staff user created.
Restarting Apache httpd web server: apache2.
Starting Koha worker daemon for test (default):.
Starting Koha indexing daemon for test:.
```
[+] Comment 1 Tomás Cohen Arazi (tcohen) 2025-05-21 19:48:50 UTC Comment hidden (obsolete)
[+] Comment 2 Tomás Cohen Arazi (tcohen) 2025-05-21 19:48:52 UTC Comment hidden (obsolete)
[+] Comment 3 Tomás Cohen Arazi (tcohen) 2025-05-21 19:53:24 UTC Comment hidden (obsolete)
Comment 4 Magnus Enger 2025-05-22 06:42:50 UTC
Created attachment 182716 [details] [review]
Bug 39961: Make `koha-create` start all queues

Taking advantage of the `get_worker_queues` function introduced in bug
31124, this patch makes `koha-create` start all defined queues.

To test:
1. Run:
   $ ktd --shell
  k$ sudo -s
  k$ koha-create --create-db test
=> FAIL: No mention of `long_tasks`
2. Apply 31124 and then this patch
3. Run:
  k$ cp debian/scripts/koha-functions.sh \
        /usr/share/koha/bin/koha-functions.sh
  k$ debian/scripts/koha-create --create-db test1
=> SUCCESS: `long_tasks` worker is started
4. Sign off :-D

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Comment 5 Magnus Enger 2025-05-22 06:42:53 UTC
Created attachment 182717 [details] [review]
Bug 39961: (follow-up) Make `koha-disable` stop all queues

This patch applies the same logic to `koha-disable`.

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Comment 6 Marcel de Rooy 2025-06-06 08:03:13 UTC
Created attachment 183055 [details] [review]
Bug 39961: Make `koha-create` start all queues

Taking advantage of the `get_worker_queues` function introduced in bug
31124, this patch makes `koha-create` start all defined queues.

To test:
1. Run:
   $ ktd --shell
  k$ sudo -s
  k$ koha-create --create-db test
=> FAIL: No mention of `long_tasks`
2. Apply 31124 and then this patch
3. Run:
  k$ cp debian/scripts/koha-functions.sh \
        /usr/share/koha/bin/koha-functions.sh
  k$ debian/scripts/koha-create --create-db test1
=> SUCCESS: `long_tasks` worker is started
4. Sign off :-D

Signed-off-by: Magnus Enger <magnus@libriotech.no>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 7 Marcel de Rooy 2025-06-06 08:03:16 UTC
Created attachment 183056 [details] [review]
Bug 39961: (follow-up) Make `koha-disable` stop all queues

This patch applies the same logic to `koha-disable`.

Signed-off-by: Magnus Enger <magnus@libriotech.no>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 8 Lucas Gass (lukeg) 2025-06-06 15:44:18 UTC
Nice work everyone!

Pushed to main for 25.11
Comment 9 Paul Derscheid 2025-06-22 21:47:07 UTC
Nice work everyone!

Pushed to 25.05.x for 25.05.03