|
Lines 14-21
if [ -r $CONFIG ]; then
Link Here
|
| 14 |
fi |
14 |
fi |
| 15 |
|
15 |
|
| 16 |
conf=/etc/mysql/koha-common.cnf |
16 |
conf=/etc/mysql/koha-common.cnf |
| 17 |
if [ ! -e "$conf" ] && [ ! -L "$conf" ] |
17 |
if [ ! -e "$conf" ] && [ ! -L "$conf" ]; then |
| 18 |
then |
|
|
| 19 |
ln -s debian.cnf "$conf" |
18 |
ln -s debian.cnf "$conf" |
| 20 |
fi |
19 |
fi |
| 21 |
|
20 |
|
|
Lines 25-31
koha-upgrade-schema $(koha-list)
Link Here
|
| 25 |
|
24 |
|
| 26 |
# Generate a config file if one doesn't exist already |
25 |
# Generate a config file if one doesn't exist already |
| 27 |
if [ ! -e $CONFIG ]; then |
26 |
if [ ! -e $CONFIG ]; then |
| 28 |
cat <<EOF > $CONFIG |
27 |
cat <<EOF >$CONFIG |
| 29 |
## Automatic template translation update |
28 |
## Automatic template translation update |
| 30 |
# |
29 |
# |
| 31 |
# This variable controls whether template translations should |
30 |
# This variable controls whether template translations should |
|
Lines 48-57
else
Link Here
|
| 48 |
UPDATE="yes" |
47 |
UPDATE="yes" |
| 49 |
fi |
48 |
fi |
| 50 |
# In case they were removed/commented out, we add it in. |
49 |
# In case they were removed/commented out, we add it in. |
| 51 |
grep -Eq '^ *AUTOMATIC_TRANSLATIONS_UPDATE=' $CONFIG || \ |
50 |
grep -Eq '^ *AUTOMATIC_TRANSLATIONS_UPDATE=' $CONFIG || |
| 52 |
echo "AUTOMATIC_TRANSLATIONS_UPDATE=" >> $CONFIG |
51 |
echo "AUTOMATIC_TRANSLATIONS_UPDATE=" >>$CONFIG |
| 53 |
|
52 |
|
| 54 |
sed -e "s/^ *AUTOMATIC_TRANSLATIONS_UPDATE=.*/AUTOMATIC_TRANSLATIONS_UPDATE=\"$UPDATE\"/" < $CONFIG > $CONFIG.tmp |
53 |
sed -e "s/^ *AUTOMATIC_TRANSLATIONS_UPDATE=.*/AUTOMATIC_TRANSLATIONS_UPDATE=\"$UPDATE\"/" <$CONFIG >$CONFIG.tmp |
| 55 |
mv -f $CONFIG.tmp $CONFIG |
54 |
mv -f $CONFIG.tmp $CONFIG |
| 56 |
|
55 |
|
| 57 |
if [ "$AUTOMATIC_TRANSLATIONS_UPDATE" = "yes" ]; then |
56 |
if [ "$AUTOMATIC_TRANSLATIONS_UPDATE" = "yes" ]; then |
|
Lines 81-90
fi
Link Here
|
| 81 |
# Check if we need to rename the Apache vhost files |
80 |
# Check if we need to rename the Apache vhost files |
| 82 |
RENAME_APACHE_FILES="no" |
81 |
RENAME_APACHE_FILES="no" |
| 83 |
for vhost in $(koha-list); do |
82 |
for vhost in $(koha-list); do |
| 84 |
if [ -f "/etc/apache2/sites-available/$vhost" ] && \ |
83 |
if [ -f "/etc/apache2/sites-available/$vhost" ] && |
| 85 |
[ ! -f "/etc/apache2/sites-available/$vhost.conf" ]; then |
84 |
[ ! -f "/etc/apache2/sites-available/$vhost.conf" ]; then |
| 86 |
RENAME_APACHE_FILES="yes" |
85 |
RENAME_APACHE_FILES="yes" |
| 87 |
break # at least one, trigger renaming |
86 |
break # at least one, trigger renaming |
| 88 |
fi |
87 |
fi |
| 89 |
done |
88 |
done |
| 90 |
|
89 |
|
|
Lines 107-127
EOF
Link Here
|
| 107 |
# We have to rename the Apache files |
106 |
# We have to rename the Apache files |
| 108 |
for site in $(koha-list); do |
107 |
for site in $(koha-list); do |
| 109 |
ENABLE_VHOST="yes" |
108 |
ENABLE_VHOST="yes" |
| 110 |
if [ -f "/etc/apache2/sites-available/$site" ] && \ |
109 |
if [ -f "/etc/apache2/sites-available/$site" ] && |
| 111 |
[ ! -f "/etc/apache2/sites-available/$site.conf" ]; then |
110 |
[ ! -f "/etc/apache2/sites-available/$site.conf" ]; then |
| 112 |
if [ ! -f "/etc/apache2/sites-enabled/$site" ]; then |
111 |
if [ ! -f "/etc/apache2/sites-enabled/$site" ]; then |
| 113 |
ENABLE_VHOST="no" |
112 |
ENABLE_VHOST="no" |
| 114 |
fi |
113 |
fi |
| 115 |
a2dissite $site > /dev/null 2>&1 || true |
114 |
a2dissite $site >/dev/null 2>&1 || true |
| 116 |
rm -f "/etc/apache2/sites-enabled/$site" |
115 |
rm -f "/etc/apache2/sites-enabled/$site" |
| 117 |
# Rename the vhost definition files |
116 |
# Rename the vhost definition files |
| 118 |
mv "/etc/apache2/sites-available/$site" \ |
117 |
mv "/etc/apache2/sites-available/$site" \ |
| 119 |
"/etc/apache2/sites-available/$site.conf" |
118 |
"/etc/apache2/sites-available/$site.conf" |
| 120 |
|
119 |
|
| 121 |
if [ "$ENABLE_VHOST" = "yes" ]; then |
120 |
if [ "$ENABLE_VHOST" = "yes" ]; then |
| 122 |
if ! { |
121 |
if ! { |
| 123 |
a2ensite "$site" > /dev/null 2>&1 || |
122 |
a2ensite "$site" >/dev/null 2>&1 || |
| 124 |
a2ensite "${site}.conf" > /dev/null 2>&1 |
123 |
a2ensite "${site}.conf" >/dev/null 2>&1 |
| 125 |
}; then |
124 |
}; then |
| 126 |
echo "Warning: problem enabling $site in Apache" >&2 |
125 |
echo "Warning: problem enabling $site in Apache" >&2 |
| 127 |
fi |
126 |
fi |
|
Lines 131-138
EOF
Link Here
|
| 131 |
fi |
130 |
fi |
| 132 |
fi |
131 |
fi |
| 133 |
|
132 |
|
| 134 |
log4perl_component() |
133 |
log4perl_component() { |
| 135 |
{ |
|
|
| 136 |
local config=$1 |
134 |
local config=$1 |
| 137 |
local component=$2 |
135 |
local component=$2 |
| 138 |
|
136 |
|
|
Lines 147-153
log4perl_component()
Link Here
|
| 147 |
for site in $(koha-list); do |
145 |
for site in $(koha-list); do |
| 148 |
log4perl_config="/etc/koha/sites/$site/log4perl.conf" |
146 |
log4perl_config="/etc/koha/sites/$site/log4perl.conf" |
| 149 |
if ! log4perl_component $log4perl_config "z3950"; then |
147 |
if ! log4perl_component $log4perl_config "z3950"; then |
| 150 |
cat <<EOF >> $log4perl_config |
148 |
cat <<EOF >>$log4perl_config |
| 151 |
log4perl.logger.z3950 = WARN, Z3950 |
149 |
log4perl.logger.z3950 = WARN, Z3950 |
| 152 |
log4perl.appender.Z3950=Log::Log4perl::Appender::File |
150 |
log4perl.appender.Z3950=Log::Log4perl::Appender::File |
| 153 |
log4perl.appender.Z3950.filename=/var/log/koha/$site/z3950-error.log |
151 |
log4perl.appender.Z3950.filename=/var/log/koha/$site/z3950-error.log |
|
Lines 160-166
EOF
Link Here
|
| 160 |
fi |
158 |
fi |
| 161 |
|
159 |
|
| 162 |
if ! log4perl_component $log4perl_config "api"; then |
160 |
if ! log4perl_component $log4perl_config "api"; then |
| 163 |
cat <<EOF >> $log4perl_config |
161 |
cat <<EOF >>$log4perl_config |
| 164 |
log4perl.logger.api = WARN, API |
162 |
log4perl.logger.api = WARN, API |
| 165 |
log4perl.appender.API=Log::Log4perl::Appender::File |
163 |
log4perl.appender.API=Log::Log4perl::Appender::File |
| 166 |
log4perl.appender.API.filename=/var/log/koha/$site/api-error.log |
164 |
log4perl.appender.API.filename=/var/log/koha/$site/api-error.log |
|
Lines 176-182
done
Link Here
|
| 176 |
for site in $(koha-list); do |
174 |
for site in $(koha-list); do |
| 177 |
log4perl_config="/etc/koha/sites/$site/log4perl.conf" |
175 |
log4perl_config="/etc/koha/sites/$site/log4perl.conf" |
| 178 |
if ! log4perl_component $log4perl_config "sip"; then |
176 |
if ! log4perl_component $log4perl_config "sip"; then |
| 179 |
cat <<EOF >> $log4perl_config |
177 |
cat <<EOF >>$log4perl_config |
| 180 |
log4perl.logger.sip = DEBUG, SIP |
178 |
log4perl.logger.sip = DEBUG, SIP |
| 181 |
log4perl.appender.SIP=Log::Log4perl::Appender::File |
179 |
log4perl.appender.SIP=Log::Log4perl::Appender::File |
| 182 |
log4perl.appender.SIP.filename=/var/log/koha/$site/sip.log |
180 |
log4perl.appender.SIP.filename=/var/log/koha/$site/sip.log |
|
Lines 192-198
done
Link Here
|
| 192 |
for site in $(koha-list); do |
190 |
for site in $(koha-list); do |
| 193 |
log4perl_config="/etc/koha/sites/$site/log4perl.conf" |
191 |
log4perl_config="/etc/koha/sites/$site/log4perl.conf" |
| 194 |
if ! log4perl_component $log4perl_config "plack-opac"; then |
192 |
if ! log4perl_component $log4perl_config "plack-opac"; then |
| 195 |
cat <<EOF >> $log4perl_config |
193 |
cat <<EOF >>$log4perl_config |
| 196 |
log4perl.logger.plack-opac = WARN, PLACKOPAC |
194 |
log4perl.logger.plack-opac = WARN, PLACKOPAC |
| 197 |
log4perl.appender.PLACKOPAC=Log::Log4perl::Appender::File |
195 |
log4perl.appender.PLACKOPAC=Log::Log4perl::Appender::File |
| 198 |
log4perl.appender.PLACKOPAC.filename=/var/log/koha/$site/plack-opac-error.log |
196 |
log4perl.appender.PLACKOPAC.filename=/var/log/koha/$site/plack-opac-error.log |
|
Lines 208-214
done
Link Here
|
| 208 |
for site in $(koha-list); do |
206 |
for site in $(koha-list); do |
| 209 |
log4perl_config="/etc/koha/sites/$site/log4perl.conf" |
207 |
log4perl_config="/etc/koha/sites/$site/log4perl.conf" |
| 210 |
if ! log4perl_component $log4perl_config "plack-api"; then |
208 |
if ! log4perl_component $log4perl_config "plack-api"; then |
| 211 |
cat <<EOF >> $log4perl_config |
209 |
cat <<EOF >>$log4perl_config |
| 212 |
log4perl.logger.plack-api = WARN, PLACKAPI |
210 |
log4perl.logger.plack-api = WARN, PLACKAPI |
| 213 |
log4perl.appender.PLACKAPI=Log::Log4perl::Appender::File |
211 |
log4perl.appender.PLACKAPI=Log::Log4perl::Appender::File |
| 214 |
log4perl.appender.PLACKAPI.filename=/var/log/koha/$site/plack-api-error.log |
212 |
log4perl.appender.PLACKAPI.filename=/var/log/koha/$site/plack-api-error.log |
|
Lines 224-230
done
Link Here
|
| 224 |
for site in $(koha-list); do |
222 |
for site in $(koha-list); do |
| 225 |
log4perl_config="/etc/koha/sites/$site/log4perl.conf" |
223 |
log4perl_config="/etc/koha/sites/$site/log4perl.conf" |
| 226 |
if ! log4perl_component $log4perl_config "plack-intranet"; then |
224 |
if ! log4perl_component $log4perl_config "plack-intranet"; then |
| 227 |
cat <<EOF >> $log4perl_config |
225 |
cat <<EOF >>$log4perl_config |
| 228 |
log4perl.logger.plack-intranet = WARN, PLACKINTRANET |
226 |
log4perl.logger.plack-intranet = WARN, PLACKINTRANET |
| 229 |
log4perl.appender.PLACKINTRANET=Log::Log4perl::Appender::File |
227 |
log4perl.appender.PLACKINTRANET=Log::Log4perl::Appender::File |
| 230 |
log4perl.appender.PLACKINTRANET.filename=/var/log/koha/$site/plack-intranet-error.log |
228 |
log4perl.appender.PLACKINTRANET.filename=/var/log/koha/$site/plack-intranet-error.log |
|
Lines 240-246
done
Link Here
|
| 240 |
for site in $(koha-list); do |
238 |
for site in $(koha-list); do |
| 241 |
log4perl_config="/etc/koha/sites/$site/log4perl.conf" |
239 |
log4perl_config="/etc/koha/sites/$site/log4perl.conf" |
| 242 |
if ! log4perl_component $log4perl_config "worker"; then |
240 |
if ! log4perl_component $log4perl_config "worker"; then |
| 243 |
cat <<EOF >> $log4perl_config |
241 |
cat <<EOF >>$log4perl_config |
| 244 |
log4perl.logger.worker = WARN, WORKER |
242 |
log4perl.logger.worker = WARN, WORKER |
| 245 |
log4perl.appender.WORKER=Log::Log4perl::Appender::Screen |
243 |
log4perl.appender.WORKER=Log::Log4perl::Appender::Screen |
| 246 |
log4perl.appender.WORKER.stderr=1 |
244 |
log4perl.appender.WORKER.stderr=1 |
|
Lines 252-260
EOF
Link Here
|
| 252 |
fi |
250 |
fi |
| 253 |
done |
251 |
done |
| 254 |
|
252 |
|
|
|
253 |
for site in $(koha-list); do |
| 254 |
log4perl_config="/etc/koha/sites/$site/log4perl.conf" |
| 255 |
if ! log4perl_component $log4perl_config "edi"; then |
| 256 |
cat <<EOF >>$log4perl_config |
| 257 |
log4perl.logger.edi = TRACE, EDI |
| 258 |
log4perl.appender.EDI=Log::Log4perl::Appender::File |
| 259 |
log4perl.appender.EDI.filename=/var/log/koha/$site/editrace.log |
| 260 |
log4perl.appender.EDI.mode=append |
| 261 |
log4perl.appender.EDI.layout=PatternLayout |
| 262 |
log4perl.appender.EDI.layout.ConversionPattern=[%d] [%P] [%p] %X{accountid}@%X{peeraddr}: %m %l%n |
| 263 |
log4perl.appender.EDI.utf8=1 |
| 264 |
|
| 265 |
EOF |
| 266 |
fi |
| 267 |
done |
| 268 |
|
| 255 |
for site in $(koha-list); do |
269 |
for site in $(koha-list); do |
| 256 |
kohaconfig="/etc/koha/sites/$site/koha-conf.xml" |
270 |
kohaconfig="/etc/koha/sites/$site/koha-conf.xml" |
| 257 |
logdir="$( xmlstarlet sel -t -v 'yazgfs/config/logdir' $kohaconfig )" |
271 |
logdir="$(xmlstarlet sel -t -v 'yazgfs/config/logdir' $kohaconfig)" |
| 258 |
if [ "$logdir" != "" ] && [ "$logdir" != "0" ]; then |
272 |
if [ "$logdir" != "" ] && [ "$logdir" != "0" ]; then |
| 259 |
chown -R $site-koha:$site-koha $logdir |
273 |
chown -R $site-koha:$site-koha $logdir |
| 260 |
else |
274 |
else |
|
Lines 267-273
done
Link Here
|
| 267 |
# that we're fixing them from is there, so we just run it every time. Maybe |
281 |
# that we're fixing them from is there, so we just run it every time. Maybe |
| 268 |
# in many years time we can get rid of this, when no one will be running |
282 |
# in many years time we can get rid of this, when no one will be running |
| 269 |
# Koha < 3.20. |
283 |
# Koha < 3.20. |
| 270 |
for zfile in $( find /etc/koha/sites -name zebra-authorities-dom.cfg -or -name zebra-biblios-dom.cfg ); do |
284 |
for zfile in $(find /etc/koha/sites -name zebra-authorities-dom.cfg -or -name zebra-biblios-dom.cfg); do |
| 271 |
perl -p -i -e 's{^modulePath: /usr/lib/idzebra-2.0/modules$}{modulePath: /usr/lib/idzebra-2.0/modules:/usr/lib/x86_64-linux-gnu/idzebra-2.0/modules:/usr/lib/i386-linux-gnu/idzebra-2.0/modules:/usr/lib/aarch64-linux-gnu/idzebra-2.0/modules:/usr/lib/arm-linux-gnueabi/idzebra-2.0/modules:/usr/lib/arm-linux-gnueabihf/idzebra-2.0/modules:/usr/lib/mips-linux-gnu/idzebra-2.0/modules:/usr/lib/mipsel-linux-gnu/idzebra-2.0/modules:/usr/lib/powerpc-linux-gnu/idzebra-2.0/modules:/usr/lib/powerpc64le-linux-gnu/idzebra-2.0/modules:/usr/lib/s390x-linux-gnu/idzebra-2.0/modules}' $zfile |
285 |
perl -p -i -e 's{^modulePath: /usr/lib/idzebra-2.0/modules$}{modulePath: /usr/lib/idzebra-2.0/modules:/usr/lib/x86_64-linux-gnu/idzebra-2.0/modules:/usr/lib/i386-linux-gnu/idzebra-2.0/modules:/usr/lib/aarch64-linux-gnu/idzebra-2.0/modules:/usr/lib/arm-linux-gnueabi/idzebra-2.0/modules:/usr/lib/arm-linux-gnueabihf/idzebra-2.0/modules:/usr/lib/mips-linux-gnu/idzebra-2.0/modules:/usr/lib/mipsel-linux-gnu/idzebra-2.0/modules:/usr/lib/powerpc-linux-gnu/idzebra-2.0/modules:/usr/lib/powerpc64le-linux-gnu/idzebra-2.0/modules:/usr/lib/s390x-linux-gnu/idzebra-2.0/modules}' $zfile |
| 272 |
done |
286 |
done |
| 273 |
|
287 |
|