Bugzilla – Attachment 54374 Details for
Bug 16974
koha-plack should check and fix log files permissions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16974: Make koha-plack should check and fix log files permissions
Bug-16974-Make-koha-plack-should-check-and-fix-log.patch (text/plain), 2.43 KB, created by
Jonathan Druart
on 2016-08-12 12:54:02 UTC
(
hide
)
Description:
Bug 16974: Make koha-plack should check and fix log files permissions
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-08-12 12:54:02 UTC
Size:
2.43 KB
patch
obsolete
>From 0f30855f3e428915608916c33ff1b4453d1e6cce Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@unc.edu.ar> >Date: Mon, 25 Jul 2016 15:08:00 -0300 >Subject: [PATCH] Bug 16974: Make koha-plack should check and fix log files > permissions > >This patch adds a function to the koha-plack script so it checks for log file >existence and its permissions. This function is called from the start_plack function. > >If some of this conditions are not fulfilled, it solves the situation by either >touching and/or changing the permissions accordingly for the instances' plack log files. > >To test: >- Run (on kohadevbox): > $ cd kohaclone > $ debian/scripts/koha-plack --start kohadev > $ debian/scripts/koha-plack --stop kohadev > $ ls /var/log/koha/kohadev/plack* >- Verify ownership of the created files (they might belong to the root user) >- Apply the patch >- Run: > $ chown root:root /var/log/koha/kohadev/plack* > $ debian/scripts/koha-plack --start kohadev > $ ls /var/log/koha/kohadev/plack* >=> SUCCESS: Files belong to kohadev-koha:kohadev-koha >- Run: > $ debian/scripts/koha-plack --stop kohadev > $ rm /var/log/koha/kohadev/plack* > $ debian/scripts/koha-plack --start kohadev > $ ls /var/log/koha/kohadev/plack* >=> SUCCESS: Files are created and belong to kohadev-koha:kohadev-koha >- Sign off :-D > >Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > debian/scripts/koha-plack | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) > >diff --git a/debian/scripts/koha-plack b/debian/scripts/koha-plack >index c0da9d1..ed0f421 100755 >--- a/debian/scripts/koha-plack >+++ b/debian/scripts/koha-plack >@@ -72,6 +72,8 @@ start_plack() > PSGIFILE="/etc/koha/sites/${instancename}/plack.psgi" > fi #Â else stick with the default one > >+ _check_and_fix_perms $instancename >+ > STARMANOPTS="-M FindBin --max-requests 50 --workers 2 \ > --user=${instancename}-koha --group ${instancename}-koha \ > --pid ${PIDFILE} \ >@@ -204,6 +206,22 @@ EOM > fi > } > >+_check_and_fix_perms() >+{ >+ local instance=$1 >+ >+ local files="/var/log/koha/${instance}/plack.log \ >+ /var/log/koha/${instance}/plack-error.log" >+ >+ for file in ${files} >+ do >+ if [ ! -e "${file}" ]; then >+ touch ${file} >+ fi >+ chown "${instance}-koha":"${instance}-koha" ${file} >+ done >+} >+ > set_action() > { > if [ "$op" = "" ]; then >-- >2.8.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 16974
:
53714
|
54319
| 54374