Bugzilla – Attachment 121444 Details for
Bug 28364
koha-z3950-responder breaks because of log4perl.conf permissions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28364: Make log4perl.conf belong to the instance user
Bug-28364-Make-log4perlconf-belong-to-the-instance.patch (text/plain), 3.19 KB, created by
Martin Renvoize (ashimema)
on 2021-05-27 08:52:41 UTC
(
hide
)
Description:
Bug 28364: Make log4perl.conf belong to the instance user
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-05-27 08:52:41 UTC
Size:
3.19 KB
patch
obsolete
>From a6a888b8649f31236c54a6334be08d3511db2335 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 17 May 2021 10:29:01 -0300 >Subject: [PATCH] Bug 28364: Make log4perl.conf belong to the instance user > >This patch makes koha-create generate the log4perl.conf file for the >instance, belonging to the instance user. This is done in order to have >the z3950 responder work. > >My original idea was to make the responder accept a '-g' parameter but >that is not supported by Net::Z3950::Responder. Also, as the library >insists on handling the PID file on its own, it wont' work to handle the >responsability to start-stop-daemon. The only solution I found was >making the fiel be owned by the instance user. > >1. Create a Koha instance: > $ koha-create --create-db test >2. Initiate all the things >3. Enable and start the z3950 responder > $ koha-z3950-responder --enable test > $ koha-z3950-responder --start test >4. Try doing some search: > $ yaz-client localhost:2100 >=> FAIL: you get: >Connecting...OK. >Sent initrequest. >Target closed connection >Z> quit >See you later, alligator. >=> FAIL: No warning or anything on the logs >5. Stop the daemon > $ koha-z3950-responder --stop test >6. Run it manually: > $ PERL5LIB=/usr/share/koha/lib KOHA_CONF=/etc/koha/sites/test/koha-conf.xml \ > /usr/bin/perl /usr/share/koha/bin/z3950_responder.pl \ > -c /etc/koha/sites/test/z3950 -u test-koha \ > -p /var/run/koha/test/z3950-responder.pid -d test-koha-z3950 >7. Repeat the 4, on a separate terminal (no daemon mode this time) >=> FAIL: You get: >Cannot open /etc/koha/sites/test/log4perl.conf (Permission denied) at /usr/share/perl5/Log/Log4perl/Config/BaseConfigurator.pm line 51. >8. Change the file owner: > $ chown test-koha /etc/koha/sites/test/log4perl.conf >9. Repeat 6, and 4 >=> SUCCESS: It doesn't break anymore! >10. Apply this patch >11. Create a new instance, with the patched koha-create: > $ debian/scripts/koha-create --create-db test1 >12: Check the generated files permissions: > $ ls -l /etc/koha/sites/test2 >=> SUCCESS: You get: >-rw-r----- 1 root test2-koha 19720 May 17 13:26 koha-conf.xml >-rw-r----- 1 test2-koha test2-koha 2825 May 17 13:26 log4perl.conf >-rw-r----- 1 root test2-koha 2014 May 17 13:26 zebra-authorities-dom.cfg >-rw-r----- 1 root test2-koha 2279 May 17 13:26 zebra-biblios-dom.cfg >-rw-r----- 1 root test2-koha 26 May 17 13:26 zebra.passwd > >13. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > debian/scripts/koha-create | 3 +++ > 1 file changed, 3 insertions(+) > >diff --git a/debian/scripts/koha-create b/debian/scripts/koha-create >index 6aef230b3e..30046b2dbb 100755 >--- a/debian/scripts/koha-create >+++ b/debian/scripts/koha-create >@@ -102,6 +102,9 @@ EOF > generate_config_file() { > touch "$2" > chown "root:$username" "$2" >+ # Bug 28364: the z3950 responder needs other permissions >+ [ "$1" = "log4perl-site.conf.in" ] && chown "$username:$username" "$2" >+ > chmod 0640 "$2" > sed -e "s/__KOHA_CONF_DIR__/\/etc\/koha\/sites\/$name/g" \ > -e "s/__KOHASITE__/$name/g" \ >-- >2.20.1
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 28364
:
121056
|
121081
| 121444