Line 0
Link Here
|
|
|
1 |
#!/bin/sh |
2 |
# |
3 |
# koha-restart-indexer -- Restart Indexer Daemon for named Koha instandes |
4 |
# Copyright 2012 Tomás Cohen Arazi @ Universidad Nacional de Córdoba |
5 |
# |
6 |
# This program is free software: you can redistribute it and/or modify |
7 |
# it under the terms of the GNU General Public License as published by |
8 |
# the Free Software Foundation, either version 3 of the License, or |
9 |
# (at your option) any later version. |
10 |
# |
11 |
# This program is distributed in the hope that it will be useful, |
12 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 |
# GNU General Public License for more details. |
15 |
# |
16 |
# You should have received a copy of the GNU General Public License |
17 |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
18 |
|
19 |
set -e |
20 |
|
21 |
. /lib/lsb/init-functions |
22 |
|
23 |
INDEXDAEMON="koha-index-daemon" |
24 |
PERL5LIB="/usr/share/koha/lib" |
25 |
|
26 |
for name in "$@" |
27 |
do |
28 |
|
29 |
KOHA_CONF="/etc/koha/sites/$name/koha-conf.xml" |
30 |
|
31 |
INDEXDAEMON_OPTS="--timeout 30 \ |
32 |
--conf $KOHA_CONF \ |
33 |
--directory /var/tmp/koha-indexer-daemon-$name" |
34 |
|
35 |
DAEMONOPTS="--name=$name-koha-indexer \ |
36 |
--errlog=/var/log/koha/$name/koha-indexer-error.log \ |
37 |
--stdout=/var/log/koha/$name/koha-indexer.log \ |
38 |
--output=/var/log/koha/$name/koha-indexer-output.log \ |
39 |
--verbose=1 --respawn --delay=30 \ |
40 |
--user=$name-koha.$name-koha" |
41 |
|
42 |
log_daemon_msg "Restarting Koha indexing daemon for $name" |
43 |
|
44 |
if daemon $DAEMONOPTS --restart -- $INDEXDAEMON $INDEXDAEMON_OPTS; then |
45 |
log_end_msg 0 |
46 |
else |
47 |
log_end_msg 1 |
48 |
fi |
49 |
|
50 |
done |