3 # koha-start-zebra - Start Zebra for named Koha instances
4 # Copyright 2010 Catalyst IT, Ltd
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.
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.
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/>.
36 if ! is_instance $instancename; then
40 if grep -q '^[[:space:]]*Include /etc/koha/apache-shared-disable.conf' \
41 "/etc/apache2/sites-available/$instancename" ; then
52 if find /etc/koha/sites -mindepth 1 -maxdepth 1 \
53 -type d -printf '%f\n'\
54 | grep -q -x $instancename ; then
65 if daemon --name="$instancename-koha-zebra" \
66 --user="$instancename-koha.$instancename-koha" \
74 start_zebra_instance()
78 if is_enabled $instancename; then
79 echo "Starting Zebra server for $instancename"
80 touch "/var/log/koha/$instancename/zebra-error.log" \
81 "/var/log/koha/$instancename/zebra.log" \
82 "/var/log/koha/$instancename/zebra-output.log"
83 chown "$instancename-koha:$instancename-koha" \
84 "/var/log/koha/$instancename/zebra-error.log" \
85 "/var/log/koha/$instancename/zebra.log" \
86 "/var/log/koha/$instancename/zebra-output.log"
88 --name="$instancename-koha-zebra" \
89 --errlog="/var/log/koha/$instancename/zebra-error.log" \
90 --stdout="/var/log/koha/$instancename/zebra.log" \
91 --output="/var/log/koha/$instancename/zebra-output.log" \
95 --user="$instancename-koha.$instancename-koha" \
99 -f "/etc/koha/sites/$instancename/koha-conf.xml" && \
110 Starts Zebra for Koha instances.
112 Usage: $scriptname instancename1 instancename2...
117 # Parse command line.
118 #[ $# -ge 1 ] || ( usage ; die "Missing instance name..." )
120 # Loop through the instance names
123 if is_instance $name ; then
124 if is_enabled $name ; then
125 if ! is_zebra_running $name; then
126 if ! start_zebra_instance $name; then
127 warn "Something went wrong starting Zebra for $name."
130 warn "Zebra already running for instance $name."
133 warn "Instance $name disabled. No action taken."
136 warn "Unknown instance $name."