~asanjar/charms/trusty/hdp-hadoop/test

« back to all changes in this revision

Viewing changes to hooks/test/hdp_scripts/hdp_manual_install_rpm_helper_files-2.1.1.385/configuration_files/ganglia/scripts/hdp-gmond

  • Committer: amir sanjar
  • Date: 2014-07-21 19:53:44 UTC
  • Revision ID: amir.sanjar@canonical.com-20140721195344-a23z0lrebqzhl167
namenode & data node initialization

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
 
3
 
# Copyright 2011, Hortonworks Inc.  All rights reserved.
4
 
5
 
# Licensed under the Apache License, Version 2.0 (the "License");
6
 
# you may not use this file except in compliance with the License.
7
 
# You may obtain a copy of the License at
8
 
#
9
 
# http://www.apache.org/licenses/LICENSE-2.0
10
 
#
11
 
# Unless required by applicable law or agreed to in writing, software
12
 
# distributed under the License is distributed on an "AS IS" BASIS,
13
 
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 
# See the License for the specific language governing permissions and
15
 
# limitations under the License.
16
 
 
17
 
# Remember to keep this in-sync with the definition of 
18
 
# GANGLIA_RUNTIME_COMPONENTS_UNPACK_DIR in monrpmInstaller.sh.
19
 
HDP_GANGLIA_RUNTIME_COMPONENTS_DIR=/usr/libexec/hdp/ganglia
20
 
HDP_GANLIA_GMOND_STARTER=${HDP_GANGLIA_RUNTIME_COMPONENTS_DIR}/startGmond.sh
21
 
HDP_GANLIA_GMOND_STOPPER=${HDP_GANGLIA_RUNTIME_COMPONENTS_DIR}/stopGmond.sh
22
 
HDP_GANLIA_GMOND_CHECKER=${HDP_GANGLIA_RUNTIME_COMPONENTS_DIR}/checkGmond.sh
23
 
 
24
 
RETVAL=0
25
 
 
26
 
case "$1" in
27
 
   start)
28
 
      echo "============================="
29
 
      echo "Starting hdp-gmond..."
30
 
      echo "============================="
31
 
      [ -f ${HDP_GANLIA_GMOND_STARTER} ] || exit 1
32
 
      eval "${HDP_GANLIA_GMOND_STARTER}"
33
 
      RETVAL=$?
34
 
      echo
35
 
      [ $RETVAL -eq 0 ] && touch /var/lock/subsys/hdp-gmond
36
 
      ;;
37
 
 
38
 
  stop)
39
 
      echo "=================================="
40
 
      echo "Shutting down hdp-gmond..."
41
 
      echo "=================================="
42
 
      [ -f ${HDP_GANLIA_GMOND_STOPPER} ] || exit 1
43
 
      eval "${HDP_GANLIA_GMOND_STOPPER}"
44
 
      RETVAL=$?
45
 
      echo
46
 
      [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/hdp-gmond
47
 
      ;;
48
 
 
49
 
  restart|reload)
50
 
        $0 stop
51
 
        $0 start
52
 
        RETVAL=$?
53
 
        ;;
54
 
  status)
55
 
      echo "======================================="
56
 
      echo "Checking status of hdp-gmond..."
57
 
      echo "======================================="
58
 
      [ -f ${HDP_GANLIA_GMOND_CHECKER} ] || exit 1
59
 
      eval "${HDP_GANLIA_GMOND_CHECKER}"
60
 
      RETVAL=$?
61
 
      ;;
62
 
  *)
63
 
        echo "Usage: $0 {start|stop|restart|status}"
64
 
        exit 1
65
 
esac
66
 
 
67
 
exit $RETVAL