Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 73 lines (64 sloc) 1.59 KB
#!/bin/bash
#
# (c) Copyright 2009 Cloudera, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Starts a Hbase thrift
#
# chkconfig: 2345 90 10
# description: Hbase thrift
source /etc/rc.d/init.d/functions
RETVAL=0
desc="Hbase thrift daemon"
start() {
echo -n $"Starting $desc (hbase-thrift): "
daemon --user <%= user %> <%= hbase_home %>/bin/hbase-daemon.sh --config "<%= hbase_home %>/conf" start thrift
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/hbase-thrift
return $RETVAL
}
stop() {
echo -n $"Stopping $desc (hbase-thrift): "
daemon --user <%= user %> <%= hbase_home %>/bin/hbase-daemon.sh --config "<%= hbase_home %>/conf" stop thrift
RETVAL=$?
sleep 5
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/hbase-thrift
}
restart() {
stop
start
}
condrestart(){
[ -e /var/lock/subsys/hbase-thrift ] && restart || :
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
condrestart|try-restart)
condrestart
;;
*)
echo $"Usage: $0 {start|stop|restart|try-restart}"
exit 1
esac
exit $RETVAL