Koha/debian/scripts
Tomas Cohen Arazi 79fe1a6ab9 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>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-05-27 17:17:30 +02:00
..
koha-create Bug 28364: Make log4perl.conf belong to the instance user 2021-05-27 17:17:30 +02:00
koha-create-dirs
koha-disable Bug 22417: Add debian script koha-worker 2020-10-05 15:22:44 +02:00
koha-dump Bug 26947: Remove AUTO_INCREMENT 2021-01-12 12:31:58 +01:00
koha-dump-defaults
koha-elasticsearch Bug 26448: Don't overwrite commit parameter passed to koha-elasticsearch 2020-09-18 11:49:29 +02:00
koha-email-disable
koha-email-enable
koha-enable
koha-foreach Bug 25634: Warn if koha-shell returns non-zero in koha-foreach 2020-06-12 10:32:30 +02:00
koha-functions.sh Bug 22417: Add debian script koha-worker 2020-10-05 15:22:44 +02:00
koha-indexer Bug 24306: Add debug switch to koha-indexer 2020-08-13 07:55:44 +02:00
koha-list
koha-mysql
koha-mysqlcheck
koha-passwd
koha-plack Bug 25778: Fix var scope in koha-plack for PERL5LIB and KOHA_HOME 2020-08-18 15:45:49 +02:00
koha-rebuild-zebra
koha-remove Bug 22417: Add debian script koha-worker 2020-10-05 15:22:44 +02:00
koha-reset-passwd
koha-restore
koha-run-backups Bug 21111: Add --exclude-indexes to koha-run-backups 2020-11-04 12:59:34 +01:00
koha-shell Bug 25752: Stay in cwd after koha-shell 2020-07-09 11:50:42 +02:00
koha-sip Bug 24993: fix increment 2020-04-14 08:33:00 +01:00
koha-sitemap
koha-translate Bug 20116: Fix package install path for clear_cache.pl 2020-05-26 14:43:56 +02:00
koha-upgrade-schema
koha-upgrade-to-3.4
koha-worker Bug 27839: (follow-up) Update docs for koha-worker 2021-04-12 15:27:50 +02:00
koha-z3950-responder Bug 25618: Fix wrong package install path for misc dir 2020-05-29 11:44:54 +02:00
koha-zebra