Koha-clms/debian/scripts
Tomas Cohen Arazi 992bd64023 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>
(cherry picked from commit 79fe1a6ab9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c29595d4fd)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
(cherry picked from commit 964748b4b7)
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
(cherry-picked from commit 964748b4b7)
2021-06-16 07:37:00 +00:00
..
koha-create Bug 28364: Make log4perl.conf belong to the instance user 2021-06-16 07:37:00 +00:00
koha-create-dirs Bug 20428: (QA follow-up) Remove redundant directory level 2018-05-14 10:36:39 -03:00
koha-disable Bug 22235: Make maintenance scripts use koha-sip instead of koha-*-sip 2019-02-11 18:30:10 +00:00
koha-dump Bug 14564: Set permissions on configuration backups 2020-12-30 15:10:26 +01:00
koha-dump-defaults Bug 17265 - Make koha-create-defaults less greedy 2017-01-13 11:33:11 +00:00
koha-elasticsearch Bug 23137: Add reset and delete to koha-elasticsearch 2020-05-08 22:35:08 +00: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-18 09:25:16 +12:00
koha-functions.sh Bug 25481: Pass --user to start-stop-daemon when a pidfile is used 2020-05-21 20:43:06 +00:00
koha-indexer Bug 23400: Add --status to koha-indexer 2019-10-08 14:33:27 +01:00
koha-list Bug 13937: Add support for Z39.50 responder to the Debian scripts 2019-10-08 14:40:07 +01:00
koha-mysql
…
koha-mysqlcheck
…
koha-passwd Bug 13143 - Detect if the password is in a pipe 2016-01-27 06:27:08 +00:00
koha-plack Bug 25778: Fix var scope in koha-plack for PERL5LIB and KOHA_HOME 2020-09-09 21:02:41 +12: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 22128: Removed outdated comment 2019-06-28 14:28:37 +01: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
…
koha-run-backups
…
koha-shell Bug 25752: Stay in cwd after koha-shell 2020-12-11 17:18:17 +01:00
koha-sip Bug 24993: fix increment 2020-05-05 20:40:53 +00:00
koha-sitemap Bug 16733: Adjust other debian scripts using PERL5LIB 2017-01-20 14:15:27 +00:00
koha-translate Bug 21481: Remove reference of *-staff-help.po from koha-translate 2018-10-05 15:02:59 +00:00
koha-upgrade-schema Bug 16749: Add is_instance check to koha-upgrade-schema 2017-02-17 13:20:58 +00:00
koha-upgrade-to-3.4
…
koha-z3950-responder Bug 25618: Fix wrong package install path for misc dir 2020-06-15 10:09:00 +12:00
koha-zebra Bug 18909: Enable the maximum zebra records size to be specified per instance 2019-01-25 16:14:48 +00:00