Merge branch 'bug_10287' into 3.14-master
[koha.git] / misc / bin / koha-zebra-ctl.sh
index 823084d..397eb19 100755 (executable)
@@ -1,4 +1,29 @@
 #!/bin/bash
+
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+### BEGIN INIT INFO
+# Provides:          koha-zebra-daemon
+# Required-Start:    $syslog $remote_fs
+# Required-Stop:     $syslog $remote_fs
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Zebra server daemon for Koha indexing
+### END INIT INFO
+
 USER=__KOHA_USER__
 GROUP=__KOHA_GROUP__
 DBNAME=__DB_NAME__
@@ -11,7 +36,8 @@ KOHA_CONF=__KOHA_CONF_DIR__/koha-conf.xml
 RUNDIR=__ZEBRA_RUN_DIR__
 LOCKDIR=__ZEBRA_LOCK_DIR__
 # you may need to change this depending on where zebrasrv is installed
-ZEBRASRV=/usr/bin/zebrasrv
+ZEBRASRV=__PATH_TO_ZEBRA__/zebrasrv
+ZEBRAOPTIONS="-v none,fatal,warn"
 
 test -f $ZEBRASRV || exit 0
 
@@ -44,7 +70,7 @@ case "$1" in
         fi
       fi
 
-      daemon --name=$NAME --errlog=$ERRLOG --stdout=$STDOUT --output=$OUTPUT --verbose=1 --respawn --delay=30 $OTHERUSER -- $ZEBRASRV -f $KOHA_CONF 
+      daemon --name=$NAME --errlog=$ERRLOG --stdout=$STDOUT --output=$OUTPUT --verbose=1 --respawn --delay=30 $OTHERUSER -- $ZEBRASRV $ZEBRAOPTIONS -f $KOHA_CONF 
       ;;
     stop)
       echo "Stopping Zebra Server"