Bug 25693: Set correct permissions on logdir after an upgrade

Since bug 25172 we are failing loudly if the permissions are not correct
and that the logger cannot init successfully.

We must set the correct permission on upgrading.
koha-create deals with new installs

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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 88cd45b090)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ff26937f50)
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
This commit is contained in:
Jonathan Druart 2020-06-08 14:14:22 +02:00 committed by Aleisha Amohia
parent 0ed5693765
commit afd4f0e3c3
1 changed files with 10 additions and 0 deletions

View File

@ -160,6 +160,16 @@ EOF
fi
done
for site in $(koha-list); do
kohaconfig="/etc/koha/sites/$site/koha-conf.xml"
logdir="$( xmlstarlet sel -t -v 'yazgfs/config/logdir' $kohaconfig )"
if [ "$logdir" != "" ] && [ "$logdir" != "0" ]; then
chown -R $site-koha:$site-koha $logdir
else
chown -R $site-koha:$site-koha /var/log/koha/$site
fi
done
# Bug 14106 - fix the modulePath of existing koha instances so that it'll
# continue to work. This will only patch the files if the exact original string
# that we're fixing them from is there, so we just run it every time. Maybe