Fix start
[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=/usr/share/masterkey/lui/solr4/zookeeper/zookeeper.sh
26 SERVICES=""
27 DESC="Index Data Services (SOLR Zookeeper)"
28 NAME=indexdata-solr-zookeeper
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 SERVICE in $SERVICES ; do
41             if [ -d "$SERVICE" ] ; then
42                 echo "starting $SERVICE"
43                 cd $SERVICE
44                 $DAEMON $1
45             else
46                 echo "No directory at $SERVICE"
47             fi          
48         done
49         ;;
50     stop)
51         for SERVICE in $SERVICES ; do
52             if [ -d "$SERVICE" ] ; then
53                 echo  "Stopping $SERVICE"
54                 cd $SERVICE
55                 $DAEMON stop
56             else
57                 echo "No directory at $SERVICE"
58             fi
59         done
60         ;;
61   status)
62         for SERVICE in $SERVICES ; do
63             if [ -d "$SERVICE" ] ; then
64                 echo  "checking $SERVICE"
65                 cd $SERVICE
66                 $DAEMON status
67             else
68                 echo "No directory at $SERVICE"
69             fi
70         done
71         ;;
72   #reload)
73         #
74         #       If the daemon can reload its config files on the fly
75         #       for example by sending it SIGHUP, do it here.
76         #
77         #       If the daemon responds to changes in its config file
78         #       directly anyway, make this a do-nothing entry.
79         #
80         # echo "Reloading $DESC configuration files."
81         # start-stop-daemon --stop --signal 1 --quiet --pidfile \
82         #       /var/run/$NAME.pid --exec $DAEMON
83   #;;
84   restart|force-reload)
85         #
86         #       If the "reload" option is implemented, move the "force-reload"
87         #       option to the "reload" entry above. If not, "force-reload" is
88         #       just the same as "restart".
89         #
90         echo "Restarting $DESC: "
91         for srv in $SERVICES ; do
92                 $srv restart
93         done
94         ;;
95   *)
96         N=/etc/init.d/$NAME
97         # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
98         echo "Usage: $N {start|stop|restart|force-reload}" >&2
99         exit 1
100         ;;
101 esac
102
103 exit 0