Lines 131-257
EOF
Link Here
|
131 |
fi |
131 |
fi |
132 |
fi |
132 |
fi |
133 |
|
133 |
|
134 |
log4perl_component() |
|
|
135 |
{ |
136 |
local config=$1 |
137 |
local component=$2 |
138 |
|
139 |
if grep -q "log4perl.logger.$component" $config; then |
140 |
return 0 |
141 |
else |
142 |
return 1 |
143 |
fi |
144 |
} |
145 |
|
146 |
# Take care of the instance's log4perl.conf file |
147 |
for site in $(koha-list); do |
148 |
log4perl_config="/etc/koha/sites/$site/log4perl.conf" |
149 |
if ! log4perl_component $log4perl_config "z3950"; then |
150 |
cat <<EOF >> $log4perl_config |
151 |
log4perl.logger.z3950 = WARN, Z3950 |
152 |
log4perl.appender.Z3950=Log::Log4perl::Appender::File |
153 |
log4perl.appender.Z3950.filename=/var/log/koha/$site/z3950-error.log |
154 |
log4perl.appender.Z3950.mode=append |
155 |
log4perl.appender.Z3950.layout=PatternLayout |
156 |
log4perl.appender.Z3950.layout.ConversionPattern=[%d] [%p] %m %l%n |
157 |
log4perl.appender.Z3950.utf8=1 |
158 |
|
159 |
EOF |
160 |
fi |
161 |
|
162 |
if ! log4perl_component $log4perl_config "api"; then |
163 |
cat <<EOF >> $log4perl_config |
164 |
log4perl.logger.api = WARN, API |
165 |
log4perl.appender.API=Log::Log4perl::Appender::File |
166 |
log4perl.appender.API.filename=/var/log/koha/$site/api-error.log |
167 |
log4perl.appender.API.mode=append |
168 |
log4perl.appender.API.layout=PatternLayout |
169 |
log4perl.appender.API.layout.ConversionPattern=[%d] [%p] %m %l%n |
170 |
log4perl.appender.API.utf8=1 |
171 |
|
172 |
EOF |
173 |
fi |
174 |
done |
175 |
|
176 |
for site in $(koha-list); do |
177 |
log4perl_config="/etc/koha/sites/$site/log4perl.conf" |
178 |
if ! log4perl_component $log4perl_config "sip"; then |
179 |
cat <<EOF >> $log4perl_config |
180 |
log4perl.logger.sip = DEBUG, SIP |
181 |
log4perl.appender.SIP=Log::Log4perl::Appender::File |
182 |
log4perl.appender.SIP.filename=/var/log/koha/$site/sip.log |
183 |
log4perl.appender.SIP.mode=append |
184 |
log4perl.appender.SIP.layout=PatternLayout |
185 |
log4perl.appender.SIP.layout.ConversionPattern=[%d] [%P] [%p] %X{accountid}@%X{peeraddr}: %m %l%n |
186 |
log4perl.appender.SIP.utf8=1 |
187 |
|
188 |
EOF |
189 |
fi |
190 |
done |
191 |
|
192 |
for site in $(koha-list); do |
193 |
log4perl_config="/etc/koha/sites/$site/log4perl.conf" |
194 |
if ! log4perl_component $log4perl_config "plack-opac"; then |
195 |
cat <<EOF >> $log4perl_config |
196 |
log4perl.logger.plack-opac = WARN, PLACKOPAC |
197 |
log4perl.appender.PLACKOPAC=Log::Log4perl::Appender::File |
198 |
log4perl.appender.PLACKOPAC.filename=/var/log/koha/$site/plack-opac-error.log |
199 |
log4perl.appender.PLACKOPAC.mode=append |
200 |
log4perl.appender.PLACKOPAC.layout=PatternLayout |
201 |
log4perl.appender.PLACKOPAC.layout.ConversionPattern=[%d] [%p] %m%n |
202 |
log4perl.appender.PLACKOPAC.utf8=1 |
203 |
|
204 |
EOF |
205 |
fi |
206 |
done |
207 |
|
208 |
for site in $(koha-list); do |
209 |
log4perl_config="/etc/koha/sites/$site/log4perl.conf" |
210 |
if ! log4perl_component $log4perl_config "plack-api"; then |
211 |
cat <<EOF >> $log4perl_config |
212 |
log4perl.logger.plack-api = WARN, PLACKAPI |
213 |
log4perl.appender.PLACKAPI=Log::Log4perl::Appender::File |
214 |
log4perl.appender.PLACKAPI.filename=/var/log/koha/$site/plack-api-error.log |
215 |
log4perl.appender.PLACKAPI.mode=append |
216 |
log4perl.appender.PLACKAPI.layout=PatternLayout |
217 |
log4perl.appender.PLACKAPI.layout.ConversionPattern=[%d] [%p] %m%n |
218 |
log4perl.appender.PLACKAPI.utf8=1 |
219 |
|
220 |
EOF |
221 |
fi |
222 |
done |
223 |
|
224 |
for site in $(koha-list); do |
225 |
log4perl_config="/etc/koha/sites/$site/log4perl.conf" |
226 |
if ! log4perl_component $log4perl_config "plack-intranet"; then |
227 |
cat <<EOF >> $log4perl_config |
228 |
log4perl.logger.plack-intranet = WARN, PLACKINTRANET |
229 |
log4perl.appender.PLACKINTRANET=Log::Log4perl::Appender::File |
230 |
log4perl.appender.PLACKINTRANET.filename=/var/log/koha/$site/plack-intranet-error.log |
231 |
log4perl.appender.PLACKINTRANET.mode=append |
232 |
log4perl.appender.PLACKINTRANET.layout=PatternLayout |
233 |
log4perl.appender.PLACKINTRANET.layout.ConversionPattern=[%d] [%p] %m%n |
234 |
log4perl.appender.PLACKINTRANET.utf8=1 |
235 |
|
236 |
EOF |
237 |
fi |
238 |
done |
239 |
|
240 |
for site in $(koha-list); do |
241 |
log4perl_config="/etc/koha/sites/$site/log4perl.conf" |
242 |
if ! log4perl_component $log4perl_config "worker"; then |
243 |
cat <<EOF >> $log4perl_config |
244 |
log4perl.logger.worker = WARN, WORKER |
245 |
log4perl.appender.WORKER=Log::Log4perl::Appender::Screen |
246 |
log4perl.appender.WORKER.stderr=1 |
247 |
log4perl.appender.WORKER.layout=PatternLayout |
248 |
log4perl.appender.WORKER.layout.ConversionPattern=[%d] [%p] %m %l%n |
249 |
log4perl.appender.WORKER.utf8=1 |
250 |
|
251 |
EOF |
252 |
fi |
253 |
done |
254 |
|
255 |
for site in $(koha-list); do |
134 |
for site in $(koha-list); do |
256 |
kohaconfig="/etc/koha/sites/$site/koha-conf.xml" |
135 |
kohaconfig="/etc/koha/sites/$site/koha-conf.xml" |
257 |
logdir="$( xmlstarlet sel -t -v 'yazgfs/config/logdir' $kohaconfig )" |
136 |
logdir="$( xmlstarlet sel -t -v 'yazgfs/config/logdir' $kohaconfig )" |
Lines 271-276
for zfile in $( find /etc/koha/sites -name zebra-authorities-dom.cfg -or -name z
Link Here
|
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 |
150 |
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 |
151 |
done |
273 |
|
152 |
|
|
|
153 |
if [ "$1" = "configure" ]; then |
154 |
for site in $(koha-list); do |
155 |
log4perl_file="/etc/koha/sites/$site/log4perl.conf" |
156 |
temp_file=$(mktemp) |
157 |
chmod 640 $temp_file |
158 |
chown $site-koha:$site-koha $temp_file |
159 |
koha-config --create-log4perl $site > $temp_file |
160 |
ucf --debconf-ok $temp_file $log4perl_file |
161 |
ucfr koha-core $log4perl_file |
162 |
rm $temp_file |
163 |
done |
164 |
fi |
165 |
|
274 |
db_stop |
166 |
db_stop |
275 |
|
167 |
|
276 |
# Bug 18250: Correct startup order of koha-common and memcached |
168 |
# Bug 18250: Correct startup order of koha-common and memcached |