3 # This file is part of Koha.
5 # Koha is free software; you can redistribute it and/or modify it under the
6 # terms of the GNU General Public License as published by the Free Software
7 # Foundation; either version 2 of the License, or (at your option) any later
10 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License along with
15 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
16 # Suite 330, Boston, MA 02111-1307 USA
19 # Provides: koha-index-daemon-$DBNAME
20 # Required-Start: $local_fs $syslog
21 # Required-Stop: $local_fs $syslog
22 # Default-Start: 2 3 4 5
24 # X-Interactive: false
25 # Short-Description: Start/stop koha-index-daemon for $DBNAME
28 .
/lib
/lsb
/init-functions
33 NAME
=koha-index-daemon-
$DBNAME
35 PERL5LIB
=__PERL_MODULE_DIR__
36 KOHA_CONF
=__KOHA_CONF_DIR__
/koha-conf.xml
37 ERRLOG
=$LOGDIR/koha-index-daemon.err
38 STDOUT
=$LOGDIR/koha-index-daemon.log
39 OUTPUT
=$LOGDIR/koha-index-daemon-output.log
44 INDEXDAEMON
="koha-index-daemon"
45 INDEXDAEMON_OPTS
="--timeout 30 --conf $KOHA_CONF \
46 --directory /var/tmp/koha-index-daemon-$DBNAME"
48 DAEMONOPTS
="--name=$NAME \
52 --verbose=1 --respawn --delay=30"
54 USER
="--user=$USER.$GROUP"
59 log_daemon_msg
"Starting Koha indexing daemon ($DBNAME)"
60 if daemon
$DAEMONOPTS $USER -- $INDEXDAEMON $INDEXDAEMON_OPTS; then
67 log_daemon_msg
"Stopping Koha indexing daemon ($DBNAME)"
68 if daemon
$DAEMONOPTS $USER --stop -- $INDEXDAEMON $INDEXDAEMON_OPTS; then
75 log_daemon_msg
"Restarting the Koha indexing daemon ($DBNAME)"
76 if daemon
$DAEMONOPTS $USER --restart -- $INDEXDAEMON $INDEXDAEMON_OPTS; then
83 log_success_msg
"Usage: /etc/init.d/$NAME {start|stop|restart}"