koha-zebra is unable to stop and start a zebra process if ownership on /var/run/koha/instancename is wrong it already checks permissions on the relevant log files, it should also check on this directory
Created attachment 164525 [details] [review] Bug 36548: koha-zebra should fix ownership on /var/run/koha/instancename files This patch ensures the /var/run/koha/instancename/* files are owned by instancename-koha so zebra can start and stop as expected. To test, confirm that: 1. starting and stopping zebra using `koha-zebra` works as expected 2. all files in /var/run/koha/instancename/ are owned by instancename-koha Sponsored-by: Catalyst IT
*** Bug 30260 has been marked as a duplicate of this bug. ***
Using KTD, the patch also changes the permissions for the file z3950-responder.pid - they are root before the patch is applied. I don't know what effect this will have, or whether it is currently incorrect. Happy to sign off if you consider there are no issues. Z3950-responder information: https://wiki.koha-community.org/wiki/Setting_up_the_Z39.50_and_SRU_Server Before the patch (using KTD), the permissions are: ls -la /var/run/koha/kohadev/ total 60 drwxr-xr-x 4 kohadev-koha kohadev-koha 4096 May 2 23:04 . drwxr-xr-x 3 root root 4096 May 2 22:58 .. drwxr-xr-x 2 kohadev-koha kohadev-koha 4096 May 2 22:58 authorities srw-rw-rw- 1 kohadev-koha kohadev-koha 0 May 2 22:59 authoritysocket drwxr-xr-x 2 kohadev-koha kohadev-koha 4096 May 2 22:58 biblios srw-rw-rw- 1 kohadev-koha kohadev-koha 0 May 2 22:59 bibliosocket -rw-r--r-- 1 kohadev-koha kohadev-koha 5 May 2 22:59 kohadev-koha-indexer.clientpid -rw-r--r-- 1 kohadev-koha kohadev-koha 5 May 2 22:59 kohadev-koha-indexer.pid -rw-r--r-- 1 kohadev-koha kohadev-koha 5 May 2 22:58 kohadev-koha-sip.pid -rw-r--r-- 1 kohadev-koha kohadev-koha 5 May 2 22:59 kohadev-koha-worker.clientpid -rw-r--r-- 1 kohadev-koha kohadev-koha 5 May 2 22:59 kohadev-koha-worker-long_tasks.clientpid -rw-r--r-- 1 kohadev-koha kohadev-koha 5 May 2 22:59 kohadev-koha-worker-long_tasks.pid -rw-r--r-- 1 kohadev-koha kohadev-koha 5 May 2 22:59 kohadev-koha-worker.pid -rw-r--r-- 1 kohadev-koha kohadev-koha 5 May 2 22:59 kohadev-koha-zebra.clientpid -rw-r--r-- 1 kohadev-koha kohadev-koha 5 May 2 22:59 kohadev-koha-zebra.pid -rw-r--r-- 1 kohadev-koha kohadev-koha 5 May 2 22:58 plack.pid srwxr-xr-x 1 kohadev-koha kohadev-koha 0 May 2 22:58 plack.sock -rw-r--r-- 1 root root 4 May 2 22:59 z3950-responder.pid After the patch, the permissions (after stopping and restarting Zebra) are: ls -la /var/run/koha/kohadev/ total 60 drwxr-xr-x 4 kohadev-koha kohadev-koha 4096 May 2 23:05 . drwxr-xr-x 3 root root 4096 May 2 22:58 .. drwxr-xr-x 2 kohadev-koha kohadev-koha 4096 May 2 22:58 authorities srw-rw-rw- 1 kohadev-koha kohadev-koha 0 May 2 23:05 authoritysocket drwxr-xr-x 2 kohadev-koha kohadev-koha 4096 May 2 22:58 biblios srw-rw-rw- 1 kohadev-koha kohadev-koha 0 May 2 23:05 bibliosocket -rw-r--r-- 1 kohadev-koha kohadev-koha 5 May 2 22:59 kohadev-koha-indexer.clientpid -rw-r--r-- 1 kohadev-koha kohadev-koha 5 May 2 22:59 kohadev-koha-indexer.pid -rw-r--r-- 1 kohadev-koha kohadev-koha 5 May 2 22:58 kohadev-koha-sip.pid -rw-r--r-- 1 kohadev-koha kohadev-koha 5 May 2 22:59 kohadev-koha-worker.clientpid -rw-r--r-- 1 kohadev-koha kohadev-koha 5 May 2 22:59 kohadev-koha-worker-long_tasks.clientpid -rw-r--r-- 1 kohadev-koha kohadev-koha 5 May 2 22:59 kohadev-koha-worker-long_tasks.pid -rw-r--r-- 1 kohadev-koha kohadev-koha 5 May 2 22:59 kohadev-koha-worker.pid -rw-r--r-- 1 kohadev-koha kohadev-koha 5 May 2 23:05 kohadev-koha-zebra.clientpid -rw-r--r-- 1 kohadev-koha kohadev-koha 5 May 2 23:05 kohadev-koha-zebra.pid -rw-r--r-- 1 kohadev-koha kohadev-koha 5 May 2 22:58 plack.pid srwxr-xr-x 1 kohadev-koha kohadev-koha 0 May 2 22:58 plack.sock -rw-r--r-- 1 kohadev-koha kohadev-koha 4 May 2 22:59 z3950-responder.pid
More information from when trying to restart the z3950 responder: sudo koha-z3950-responder --restart kohadev Restarting Z39.50/SRU daemon for kohadev:Stopping Z39.50/SRU daemon for kohadev:start-stop-daemon: matching only on non-root pidfile /var/run/koha/kohadev/z3950-responder.pid is insecure failed! failed! If I change it back to being owned by root, it restarts as normal: sudo koha-z3950-responder --restart kohadev Restarting Z39.50/SRU daemon for kohadev:Stopping Z39.50/SRU daemon for kohadev:. Starting Z39.50/SRU daemon for kohadev:.
Should this be FQA? Sounds like it to me.
(In reply to Magnus Enger from comment #5) > Should this be FQA? Sounds like it to me. No response in ~4 months, setting to FQA.
Created attachment 174390 [details] [review] Bug 36548: koha-zebra should fix ownership on /var/run/koha/instancename files This patch ensures the /var/run/koha/instancename/* files are owned by instancename-koha so zebra can start and stop as expected. Note: /var/run/koha/instancename/z3950-responder.pid must be owned by root:root but the rest should be owned by instancename-koha To test, confirm that: 1. starting and stopping zebra using `koha-zebra` works as expected 2. all files in /var/run/koha/instancename/ are owned by instancename-koha Sponsored-by: Catalyst IT