Lots of improvements and simplifications.
* Collect all logs under the /var/log/koha directory. * Setup logrotate * Use a static instance name, leading to simpler configuration.
This commit is contained in:
parent
737f738dc7
commit
c16804a913
33 changed files with 78 additions and 71 deletions
1
files/etc/koha-envvars/INSTANCE_NAME
Normal file
1
files/etc/koha-envvars/INSTANCE_NAME
Normal file
|
|
@ -0,0 +1 @@
|
|||
default
|
||||
1
files/etc/koha-envvars/KOHA_CONF
Normal file
1
files/etc/koha-envvars/KOHA_CONF
Normal file
|
|
@ -0,0 +1 @@
|
|||
/etc/koha/sites/default/koha-conf.xml
|
||||
1
files/etc/koha-envvars/KOHA_HOME
Normal file
1
files/etc/koha-envvars/KOHA_HOME
Normal file
|
|
@ -0,0 +1 @@
|
|||
/usr/share/koha
|
||||
1
files/etc/koha-envvars/PERL5LIB
Normal file
1
files/etc/koha-envvars/PERL5LIB
Normal file
|
|
@ -0,0 +1 @@
|
|||
/usr/share/koha/lib
|
||||
14
files/etc/logrotate.d/koha-core
Normal file
14
files/etc/logrotate.d/koha-core
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
/var/log/koha/*/*.log {
|
||||
rotate 5
|
||||
weekly
|
||||
missingok
|
||||
copytruncate
|
||||
compress
|
||||
delaycompress
|
||||
notifempty
|
||||
sharedscripts
|
||||
postrotate
|
||||
/command/s6-svc -h /run/service/apache2
|
||||
/command/s6-svc -r /run/service/plack
|
||||
endscript
|
||||
}
|
||||
|
|
@ -1,3 +1,7 @@
|
|||
#!/command/execlineb -P
|
||||
fdmove -c 2 1
|
||||
apache2ctl -DFOREGROUND
|
||||
|
||||
trap { SIGTERM { apache2ctl stop }
|
||||
SIGHUP { apache2ctl graceful } }
|
||||
|
||||
apache2ctl -D "FOREGROUND"
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
oneshot
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
#!/bin/sh
|
||||
if { mkdir -p /var/log/cron }
|
||||
if { chown nobody:nogroup /var/log/cron }
|
||||
chmod 02755 /var/log/cron
|
||||
|
|
@ -1 +0,0 @@
|
|||
cron
|
||||
|
|
@ -1 +0,0 @@
|
|||
cron-pipeline
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
#!/bin/sh
|
||||
exec logutil-service /var/log/cron
|
||||
|
|
@ -1 +0,0 @@
|
|||
longrun
|
||||
|
|
@ -1 +0,0 @@
|
|||
cron-log
|
||||
|
|
@ -3,6 +3,4 @@ fdmove -c 2 1
|
|||
|
||||
s6-envdir /etc/koha-envvars
|
||||
|
||||
importas instancename INSTANCE_NAME
|
||||
|
||||
/usr/bin/starman -M FindBin --socket /var/run/koha/${instancename}/plack.sock --max-requests 50 --workers 2 -E deployment --user=${instancename}-koha --group=${instancename}-koha --access-log /dev/stdout --error-log /dev/stdout "/etc/koha/plack.psgi"
|
||||
/usr/bin/starman -M FindBin --socket /var/run/koha/default/plack.sock --max-requests 50 --workers 2 -E deployment --user=default-koha --group=default-koha --access-log /var/log/koha/default/plack.log --error-log /var/log/koha/default/plack-error.log "/etc/koha/plack.psgi"
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
oneshot
|
||||
|
|
@ -1 +0,0 @@
|
|||
/etc/s6-overlay/scripts/01-setup-koha-envvars.sh
|
||||
|
|
@ -5,8 +5,6 @@ fdmove -c 2 1
|
|||
|
||||
s6-envdir /etc/koha-envvars
|
||||
|
||||
importas instancename INSTANCE_NAME
|
||||
|
||||
s6-setuidgid ${instancename}-koha
|
||||
s6-setuidgid default-koha
|
||||
|
||||
/usr/bin/perl /usr/share/koha/bin/background_jobs_worker.pl
|
||||
|
|
|
|||
|
|
@ -3,8 +3,6 @@ fdmove -c 2 1
|
|||
|
||||
s6-envdir /etc/koha-envvars
|
||||
|
||||
importas instancename INSTANCE_NAME
|
||||
|
||||
s6-setuidgid ${instancename}-koha
|
||||
s6-setuidgid default-koha
|
||||
|
||||
/usr/bin/perl /usr/share/koha/bin/migration_tools/rebuild_zebra.pl -daemon -sleep 5
|
||||
|
|
|
|||
|
|
@ -1,10 +1,7 @@
|
|||
#!/command/execlineb -P
|
||||
s6-envdir /etc/koha-envvars
|
||||
|
||||
fdmove -c 2 1
|
||||
|
||||
importas instancename INSTANCE_NAME
|
||||
s6-setuidgid default-koha
|
||||
|
||||
s6-setuidgid ${instancename}-koha
|
||||
/usr/bin/zebrasrv -v 1 -f /etc/koha/sites/default/koha-conf.xml
|
||||
|
||||
/usr/bin/zebrasrv -v 1 -f /etc/koha/sites/${instancename}/koha-conf.xml
|
||||
|
|
|
|||
|
|
@ -1,6 +0,0 @@
|
|||
#!/command/with-contenv sh
|
||||
mkdir -p /etc/koha-envvars
|
||||
echo -n "/usr/share/koha/lib" > /etc/koha-envvars/PERL5LIB
|
||||
echo -n "/etc/koha/sites/${KOHA_INSTANCE}/koha-conf.xml" > /etc/koha-envvars/KOHA_CONF
|
||||
echo -n "/usr/share/koha" > /etc/koha-envvars/KOHA_HOME
|
||||
echo -n "${KOHA_INSTANCE}" > /etc/koha-envvars/INSTANCE_NAME
|
||||
|
|
@ -1,12 +1,13 @@
|
|||
#!/command/with-contenv bash
|
||||
|
||||
#if no koha instance name was provided, then set it as "default"
|
||||
export KOHA_INSTANCE=${KOHA_INSTANCE:-default}
|
||||
export KOHA_INSTANCE=default
|
||||
|
||||
export KOHA_INTRANET_PORT=8081
|
||||
export KOHA_OPAC_PORT=8080
|
||||
export MEMCACHED_SERVERS=${MEMCACHED_SERVERS:-memcached}
|
||||
export MYSQL_SERVER=${MYSQL_SERVER:-db}
|
||||
export DB_NAME=${DB_NAME:-koha_default}
|
||||
export MYSQL_USER=${DB_NAME:-koha_default}
|
||||
export MYSQL_PASSWORD=${MYSQL_PASSWORD:-$(pwgen -s 15 1)}
|
||||
export ZEBRA_MARC_FORMAT=${ZEBRA_MARC_FORMAT:-marc21}
|
||||
export KOHA_PLACK_NAME=${KOHA_PLACK_NAME:-koha}
|
||||
|
|
@ -21,7 +22,7 @@ export MB_PASS=${MB_PASS:-guest}
|
|||
envsubst < /docker/templates/koha-sites.conf > /etc/koha/koha-sites.conf
|
||||
|
||||
# Create entry with admin username, password and myqsl server for this instance
|
||||
echo -n "${KOHA_INSTANCE}:koha_${KOHA_INSTANCE}:${MYSQL_PASSWORD}:koha_${KOHA_INSTANCE}:${MYSQL_SERVER}" > /etc/koha/passwd
|
||||
echo -n "default:${MYSQL_USER}:${MYSQL_PASSWORD}:${DB_NAME}:${MYSQL_SERVER}" > /etc/koha/passwd
|
||||
|
||||
source /usr/share/koha/bin/koha-functions.sh
|
||||
|
||||
|
|
@ -49,7 +50,6 @@ then
|
|||
# Start zebra services with s6
|
||||
touch /etc/s6-overlay/s6-rc.d/user/contents.d/zebra-indexer
|
||||
touch /etc/s6-overlay/s6-rc.d/user/contents.d/zebra-server
|
||||
s6-rc-update
|
||||
else
|
||||
koha-elasticsearch --rebuild -p $(grep -c ^processor /proc/cpuinfo) ${KOHA_INSTANCE} &
|
||||
fi
|
||||
|
|
@ -81,7 +81,7 @@ then
|
|||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
koha-plack --enable ${KOHA_INSTANCE}
|
||||
a2enmod proxy
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue