Bugzilla – Attachment 193247 Details for
Bug 41337
koha-create --request-db and --populate-db creates log files owned by root (intranet-error.log, opac-error.log)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41337: Add missing Bash variable to `koha-create`
Bug-41337-Add-missing-Bash-variable-to-koha-create.patch (text/plain), 3.43 KB, created by
Jan Kissig
on 2026-02-16 13:49:10 UTC
(
hide
)
Description:
Bug 41337: Add missing Bash variable to `koha-create`
Filename:
MIME Type:
Creator:
Jan Kissig
Created:
2026-02-16 13:49:10 UTC
Size:
3.43 KB
patch
obsolete
>From 92b740d9ed4b5bf0befb3261289eefd0c4ad503a Mon Sep 17 00:00:00 2001 >From: Andreas Roussos <a.roussos@dataly.gr> >Date: Mon, 9 Feb 2026 15:49:03 +0000 >Subject: [PATCH] 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> >--- > debian/scripts/koha-create | 2 ++ > 1 file changed, 2 insertions(+) > >diff --git a/debian/scripts/koha-create b/debian/scripts/koha-create >index 831745ef3e3..3e3b2e4f03b 100755 >--- a/debian/scripts/koha-create >+++ b/debian/scripts/koha-create >@@ -896,6 +896,8 @@ fi > > if [ "$op" = create ] || [ "$op" = populate ] || [ "$op" = use ] > then >+ username="$name-koha" >+ > # Reconfigure Apache. > if ! { > a2ensite "$name" > /dev/null 2>&1 || >-- >2.39.5
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 41337
:
192809
|
192822
|
193015
| 193247