Koha-clms/debian/scripts
Andreas Roussos 5e0d278eab
Bug 41337: Add missing Bash variable to `koha-create`
When creating a new Koha instance using the two-step workflow
(`koha-create --request-db <instance>`, followed by
`koha-create --populate-db <instance>`), some log files under
/var/log/koha/<instance>/ end up with incorrect ownership.

Specifically, intranet-error.log and opac-error.log are owned
by root:root instead of <instance>-koha:<instance>-koha.

This patch fixes that.

Test plan (tailored for KTD):

1) Before applying this patch, run the following commands
   inside your KTD Koha container:

   $ sudo koha-create --request-db test1
   $ SQLPASS=`sudo grep password: test1-db-request.txt | cut -c 16-`
   $ mysql -hdb -uroot -ppassword -e "CREATE DATABASE koha_test1;"
   $ mysql -hdb -uroot -ppassword -e "GRANT ALL PRIVILEGES ON koha_test1.* TO 'koha_test1'@'%' IDENTIFIED BY '${SQLPASS}';"
   $ mysql -hdb -uroot -ppassword -e "FLUSH PRIVILEGES;"
   $ sudo koha-create --populate-db test1

   $ ls -l /var/log/koha/test1/
     total 8
     -rw-r--r-- 1 test1-koha test1-koha    0 Feb  9 15:35 indexer-error.log
     -rw-r--r-- 1 test1-koha test1-koha 1278 Feb  9 15:35 indexer-output.log
     -rw-r--r-- 1 root       root          0 Feb  9 15:35 intranet-error.log
     -rw-r--r-- 1 root       root          0 Feb  9 15:35 opac-error.log
     -rw-r--r-- 1 test1-koha test1-koha    0 Feb  9 15:35 worker-error.log
     -rw-r--r-- 1 test1-koha test1-koha 1828 Feb  9 15:35 worker-output.log
     -rw-r--r-- 1 test1-koha test1-koha    0 Feb  9 15:35 zebra-error.log
     -rw-r--r-- 1 test1-koha test1-koha    0 Feb  9 15:35 zebra-output.log

   Notice the incorrect user/group ownership on two
   files: `intranet-error.log` and `opac-error.log`.

2) Apply this patch, remove the `test1` instance along
   with the database request text file, and copy the
   modified script to its system-wide location:

   $ sudo koha-remove test1
   $ sudo rm test1-db-request.txt
   $ sudo cp debian/scripts/koha-create /usr/sbin/koha-create

3) Repeat the commands in Step 1. This time, the output of
   the last command should resemble the following:

   total 8
   -rw-r--r-- 1 test1-koha test1-koha    0 Feb  9 15:42 indexer-error.log
   -rw-r--r-- 1 test1-koha test1-koha 1520 Feb  9 15:42 indexer-output.log
   -rw-r--r-- 1 test1-koha test1-koha    0 Feb  9 15:42 intranet-error.log
   -rw-r--r-- 1 test1-koha test1-koha    0 Feb  9 15:42 opac-error.log
   -rw-r--r-- 1 test1-koha test1-koha    0 Feb  9 15:42 worker-error.log
   -rw-r--r-- 1 test1-koha test1-koha 1828 Feb  9 15:42 worker-output.log
   -rw-r--r-- 1 test1-koha test1-koha    0 Feb  9 15:42 zebra-error.log
   -rw-r--r-- 1 test1-koha test1-koha    0 Feb  9 15:42 zebra-output.log

   All files should now have the correct user/group ownership.

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Jan Kissig <bibliothek@th-wildau.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 7ee861e256)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
(cherry picked from commit a45a642f35)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-07-17 14:24:52 +02:00
..
koha-create Bug 41337: Add missing Bash variable to `koha-create` 2026-07-17 14:24:52 +02:00
koha-create-dirs Bug 20428: (QA follow-up) Remove redundant directory level 2018-05-14 10:36:39 -03:00
koha-disable Bug 39961: (follow-up) Make `koha-disable` stop all queues 2025-07-25 14:04:34 +02:00
koha-dump Bug 38173: Fix description of koha-dump --exclude-indexes 2024-10-23 19:14:57 +02:00
koha-dump-defaults
…
koha-elasticsearch Bug 37038: (QA follow-up) Replace \> by -gt 2024-06-28 13:49:23 +02:00
koha-email-disable
…
koha-email-enable
…
koha-enable
…
koha-es-indexer Bug 33108: koha-es-indexer added 2023-03-20 09:39:45 -03:00
koha-foreach Bug 34653: Make koha-foreach return the correct status code 2023-09-25 10:56:40 -03:00
koha-functions.sh Bug 31124: Make koha-remove stop all workers 2025-07-25 14:03:13 +02:00
koha-indexer Bug 32811: Remove useless lines for indexer.log 2023-03-06 09:51:49 -03:00
koha-list Bug 38249: Fix typo in koha-list --help 2024-10-24 13:38:11 +02:00
koha-mysql Bug 38760: Add support for database connection encryption parameters in koha-mysql 2025-08-08 16:30:20 +02:00
koha-mysqlcheck
…
koha-passwd Bug 28493: Make koha-passwd display the username 2023-07-19 13:00:41 -03:00
koha-plack Bug 35954: Add --status to koha-plack 2024-05-03 19:31:56 +02:00
koha-rebuild-zebra Bug 20795: Inform the user about this change, add to pod 2018-08-14 12:35:13 +00:00
koha-remove Bug 31124: Make koha-remove stop all workers 2025-07-25 14:03:13 +02:00
koha-reset-passwd Bug 17746: (QA follow-up) Make set_password.pl generate a password if required 2019-03-28 11:58:20 +00:00
koha-restore Bug 10517: (QA follow-up) No need to remove second true 2022-05-03 11:19:50 -10:00
koha-run-backups Bug 14565: Allow koha-run-backups to backup an instance called `demo` 2024-06-28 13:49:22 +02:00
koha-shell Bug 28519: Add lib to koha-shell 2021-06-17 15:59:40 +02:00
koha-sip Bug 30684: (follow-up) Use log_warning_msg for the "not running" warning 2022-08-18 09:00:39 -03:00
koha-sitemap
…
koha-translate Bug 38035: Exclude "sound" from the list of installed languages 2024-10-02 10:15:53 +01:00
koha-upgrade-schema Bug 39460: Fix koha-upgrade-schema when no DB change needed 2025-04-02 17:02:14 +02:00
koha-upgrade-to-3.4
…
koha-worker Bug 37787: Undocument koha-worker --queue elastic_index 2024-10-23 19:14:55 +02:00
koha-z3950-responder Bug 25716: (QA follow-up) Move additional options to etc/z3950/config.xml 2022-10-24 13:11:27 -03:00
koha-zebra Bug 27291: Reformat Zebra output logs 2024-03-22 10:35:25 +01:00