init.d script
[lui-solr.git] / etc / init.d / indexdata-solr-zookeeper
1 #! /bin/sh
2 #
3 # skeleton      example file to build /etc/init.d/ scripts.
4 #               This file should be used to construct scripts for /etc/init.d.
5 #
6 #               Written by Miquel van Smoorenburg <miquels@cistron.nl>.
7 #               Modified for Debian GNU/Linux
8 #               by Ian Murdock <imurdock@gnu.ai.mit.edu>.
9 #
10 # Version:      @(#)skeleton  1.8  03-Mar-1998  miquels@cistron.nl
11
12 ### BEGIN INIT INFO
13 # Provides:          indexdata-solr
14 # Required-Start:    $network
15 # Required-Stop:     $network
16 # Should-Start:      
17 # Default-Start:     2 3 4 5
18 # Default-Stop:      0 1 6
19 # Short-Description: Indexdata Cloud Solr (Solr with Zookeeper)
20 # Description:       startes the services on port xxxx
21 ### END INIT INFO
22 #
23
24 PATH=/usr/bin
25 DAEMON=/home/dennis/proj/lui-solr/etc/init.d/zookeeper.sh
26 SERVICES="/home/indexdata/solr-4.4.0/example/"
27 DESC="Index Data Services (SOLR Zookeeper)"
28 NAME=indexdata
29 DEFAULT=/etc/default/indexdata-solr-zookeeper
30 if [ -f "$DEFAULT" ] ; then 
31     . $DEFAULT
32 fi 
33
34 # test -d $SERVICES || exit 0
35
36 set -e
37
38 case "$1" in
39   start)
40         for srv in $SERVICES ; do
41             cd $SRV
42             $DAEMON start
43         done
44         ;;
45   stop)
46         echo  "Stopping $DESC."
47         for srv in $SERVICES ; do
48             cd $srv
49             $DAEMON stop
50         done
51         ;;
52   status)
53         echo  "Checking status for $DESC."
54         for srv in $SERVICES ; do
55             cd $srv
56             $srv status
57         done
58         ;;
59   #reload)
60         #
61         #       If the daemon can reload its config files on the fly
62         #       for example by sending it SIGHUP, do it here.
63         #
64         #       If the daemon responds to changes in its config file
65         #       directly anyway, make this a do-nothing entry.
66         #
67         # echo "Reloading $DESC configuration files."
68         # start-stop-daemon --stop --signal 1 --quiet --pidfile \
69         #       /var/run/$NAME.pid --exec $DAEMON
70   #;;
71   restart|force-reload)
72         #
73         #       If the "reload" option is implemented, move the "force-reload"
74         #       option to the "reload" entry above. If not, "force-reload" is
75         #       just the same as "restart".
76         #
77         echo "Restarting $DESC: "
78         for srv in $SERVICES ; do
79                 $srv restart
80         done
81         ;;
82   *)
83         N=/etc/init.d/$NAME
84         # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
85         echo "Usage: $N {start|stop|restart|force-reload}" >&2
86         exit 1
87         ;;
88 esac
89
90 exit 0