solr
919 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
# chkconfig: 2345 95 20
# description: Solr
# processname: myscript
#
#-----------------------------------------------------
# Script for running solr as a service.
#
# Usage: service solr {start|stop|restart|status}"
#
#-----------------------------------------------------
# This should be placed in /etc/init.d
. /etc/rc.d/init.d/functions
# Path to pid file
PIDFILE=/var/run/solr.pid
# Service name
NAME="Solr"
# Service description
DESC="start/stop Solr Server"
SOLR_INIT="/home/vagrant/solr-4.10.3/start.sh"
case $1 in
start)
action "Starting ${NAME}: " daemon --pidfile $PIDFILE $SOLR_INIT
;;
stop)
action "Stopping ${NAME}: " killproc -p $PIDFILE
;;
restart)
$0 stop
$0 start
;;
status)
status -p $PIDFILE solr
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 3
;;
esac