Skip to content
This repository
Browse code

Merge branch 'master' of github.com:naparuba/shinken

  • Loading branch information...
commit 38dd6f9166ff35afbdca1134d5c302e04620f9f6 2 parents 4e9ca47 + 0f0a081
Gabès Jean authored October 02, 2012
10  bin/shinken-discovery
@@ -53,19 +53,19 @@ parser.add_option('-c', '--cfg-input',
53 53
 parser.add_option('-o', '--dir-output', dest="output_dir",
54 54
                   help="Directory output for results")
55 55
 parser.add_option('-w', '--overwrite', dest="overwrite", action='store_true',
56  
-                  help="Allow overwithing xisting file (disabled by default)")
  56
+                  help="Allow overwriting an existing file (disabled by default)")
57 57
 parser.add_option('-r', '--runners', dest="runners",
58 58
                   help="List of runners you allow to run, (like nmap,vsphere)")
59 59
 parser.add_option('-m', '--macros', dest="macros",
60 60
                   help="List of macros (like NMAPTARGETS=192.168.0.0/24). Should be the last argument")
61 61
 parser.add_option('--db', dest="dbmod",
62  
-                  help="Optionnal : Name of the database module to use.")
  62
+                  help="Optional : Name of the database module to use")
63 63
 parser.add_option('--backend', dest="backend",
64  
-                  help="Optionnal : Name of a module that will totally manage the object writing/update thing. If you don't know what it means, maybe you should not use this option :)")
  64
+                  help="Optional : Name of a module that will totally manage the object writing/update thing. If you don't know what it means, maybe you should not use this option :)")
65 65
 parser.add_option('--modules_path', dest="modules_path",
66  
-                  help="Optionnal : Path for the module loading. If you don't know what it means, maybe you should not use this option :)")
  66
+                  help="Optional : Path for the module loading. If you don't know what it means, maybe you should not use this option :)")
67 67
 parser.add_option('--merge', dest="merge", action='store_true',
68  
-                  help="Optionnal : In multiple discovery level, it is the final host name which wins. Make possible merge of multiple IP but same final device")
  68
+                  help="Optional : In multiple discovery level, it is the final host name which wins. Make possible merge of multiple IP but same final device")
69 69
 
70 70
 
71 71
 
2  doc/man/shinken-poller.8shinken
@@ -44,3 +44,5 @@ Enable debug logging to \f[I]DEBUGFILE\f[]
44 44
 .RE
45 45
 .SH AUTHORS
46 46
 Arthur Gautier.
  47
+David Hannequin
  48
+Michael Leinartas.
8  etc/nagios.cfg
@@ -125,10 +125,10 @@ enable_environment_macros=0
125 125
 # If not need, don't dump initial states
126 126
 log_initial_states=0
127 127
 
128  
-# User that will be used by the arbiter. shinken/shinken
129  
-# by default
130  
-#shinken_user=shinken
131  
-#shinken_group=shinken
  128
+# User that will be used by the arbiter. 
  129
+# If commented, run as current user (root?)
  130
+shinken_user=shinken
  131
+shinken_group=shinken
132 132
 
133 133
 
134 134
 
8  etc/shinken-specific.cfg
@@ -551,6 +551,14 @@ define module {
551 551
     module_name     mongologs
552 552
     module_type     logstore_mongodb
553 553
     mongodb_uri     mongodb://localhost/?safe=true  ; Set to your value
  554
+    # If you are running a MongoDB cluster (called a “replica set” in MongoDB),
  555
+    # you need to specify it's name here. 
  556
+    # With this option set, you can also write the mongodb_uri as a comma-separated
  557
+    # list of host:port items. (But one is enough, it will be used as a “seed”)
  558
+    #replica_set
  559
+    #database
  560
+    #collection
  561
+    #max_logs_age
554 562
 }
555 563
 
556 564
 ## Module:      nulllogs
99  for_fedora/init.d/shinken-arbiter.init
... ...
@@ -0,0 +1,99 @@
  1
+#!/bin/sh
  2
+#
  3
+# shinken-arbiter - Startup script for the Shinken Arbiter Daemon
  4
+#
  5
+# chkconfig: - 20 80
  6
+# description:  Shinken is a monitoring tool and the Arbiter \
  7
+#               is one of its daemon. This one reads the configuration, \
  8
+#               cuts it into parts and dispatches it. Then it waits \
  9
+#               for orders from the users to dispatch them too.
  10
+
  11
+### BEGIN INIT INFO
  12
+# Provides:          shinken-arbiter
  13
+# Required-Start:    $all 
  14
+# Required-Stop:     $all
  15
+# Should-Start:    
  16
+# Should-Stop: 
  17
+# Default-Start:     2 3 4 5
  18
+# Default-Stop:      0 1 6
  19
+# Short-Description: Shinken arbiter daemon
  20
+# Description:       Shinken is a monitoring tool and the Arbiter
  21
+#                    is one of its daemon. This one reads the configuration,
  22
+#                    cuts it into parts and dispatches it. Then it waits
  23
+#                    for orders from the users to dispatch them too.
  24
+### END INIT INFO
  25
+
  26
+
  27
+
  28
+# Source function library.
  29
+. /etc/rc.d/init.d/functions
  30
+
  31
+
  32
+daemon_args="-d -c /etc/shinken/nagios.cfg -c /etc/shinken/shinken-specific.cfg"             # Arguments to run the daemon with
  33
+pidfile=/var/run/shinken/arbiterd.pid
  34
+
  35
+exec="/usr/sbin/shinken-arbiter"
  36
+prog=$(basename $exec)
  37
+
  38
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
  39
+
  40
+lockfile=/var/lock/subsys/$prog
  41
+
  42
+start() {
  43
+
  44
+    directory=$(dirname $pidfile)                                                                                                                                    
  45
+    [ ! -d $directory ] && mkdir -p $directory
  46
+    chown nagios:root $directory
  47
+
  48
+    echo -n $"Starting $prog: "
  49
+    $exec $daemon_args
  50
+    # if not running, start it up here, usually something like "daemon $exec"
  51
+    retval=$?
  52
+    echo
  53
+    [ $retval -eq 0 ] && touch $lockfile
  54
+    return $retval
  55
+}
  56
+
  57
+stop() {
  58
+    echo -n $"Stopping $prog: "
  59
+    killproc -p ${pidfile}
  60
+    # stop it here, often "killproc $prog"
  61
+    retval=$?
  62
+    echo
  63
+    [ $retval -eq 0 ] && rm -f $lockfile
  64
+    return $retval
  65
+}
  66
+
  67
+restart() {
  68
+    stop
  69
+    start
  70
+}
  71
+
  72
+case "$1" in
  73
+    start|stop|restart)
  74
+        $1
  75
+        ;;
  76
+    force-reload)
  77
+        restart
  78
+        ;;
  79
+    status)
  80
+        status $prog
  81
+        ;;
  82
+    try-restart|condrestart)
  83
+        if status $prog >/dev/null ; then
  84
+            restart
  85
+        fi
  86
+	;;
  87
+    reload)
  88
+        # If config can be reloaded without restarting, implement it here,
  89
+        # remove the "exit", and add "reload" to the usage message below.
  90
+        # For example:
  91
+        # status $prog >/dev/null || exit 7
  92
+        # killproc $prog -HUP
  93
+        action $"Service ${0##*/} does not support the reload action: " /bin/false
  94
+        exit 3
  95
+        ;;
  96
+    *)
  97
+        echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}"
  98
+        exit 2
  99
+esac
100  for_fedora/init.d/shinken-broker.init
... ...
@@ -0,0 +1,100 @@
  1
+#!/bin/sh
  2
+#
  3
+# shinken-broker - Startup script for the Shinken Broker Daemon
  4
+#
  5
+# chkconfig: 2345 20 80
  6
+# Description:  Shinken is a monitoring tool and the Broker \
  7
+#               is one of its daemon. This one gets the configuration \
  8
+#               from the arbiter. His purpose is to get the broks from \
  9
+#               the schedulers specified in the configuration.
  10
+
  11
+### BEGIN INIT INFO
  12
+# Provides:          shinken-broker
  13
+# Required-Start:    $all 
  14
+# Required-Stop:     $all
  15
+# Should-Start:    
  16
+# Should-Stop: 
  17
+# Default-Start:     2 3 4 5 
  18
+# Default-Stop:      0 1 6
  19
+# Short-Description: Shinken broker daemon
  20
+# Description:       Shinken is a monitoring tool and the Broker
  21
+#                    is one of its daemon. This one gets the configuration 
  22
+#                    from the arbiter. His purpose is to get the broks from 
  23
+#                    the schedulers specified in the configuration
  24
+### END INIT INFO
  25
+
  26
+
  27
+
  28
+
  29
+# Source function library.
  30
+. /etc/rc.d/init.d/functions
  31
+
  32
+
  33
+daemon_args="-d -c /etc/shinken/brokerd.ini"             # Arguments to run the daemon with
  34
+pidfile=/var/run/shinken/brokerd.pid
  35
+
  36
+exec="/usr/sbin/shinken-broker"
  37
+prog=$(basename $exec)
  38
+
  39
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
  40
+
  41
+lockfile=/var/lock/subsys/$prog
  42
+
  43
+start() {
  44
+
  45
+    directory=$(dirname $pidfile)                                                                                                                                    
  46
+    [ ! -d $directory ] && mkdir -p $directory
  47
+    chown nagios:root $directory
  48
+
  49
+    echo -n $"Starting $prog: "
  50
+    $exec $daemon_args
  51
+    # if not running, start it up here, usually something like "daemon $exec"
  52
+    retval=$?
  53
+    echo
  54
+    [ $retval -eq 0 ] && touch $lockfile
  55
+    return $retval
  56
+}
  57
+
  58
+stop() {
  59
+    echo -n $"Stopping $prog: "
  60
+    killproc -p ${pidfile}
  61
+    # stop it here, often "killproc $prog"
  62
+    retval=$?
  63
+    echo
  64
+    [ $retval -eq 0 ] && rm -f $lockfile
  65
+    return $retval
  66
+}
  67
+
  68
+restart() {
  69
+    stop
  70
+    start
  71
+}
  72
+
  73
+case "$1" in
  74
+    start|stop|restart)
  75
+        $1
  76
+        ;;
  77
+    force-reload)
  78
+        restart
  79
+        ;;
  80
+    status)
  81
+        status $prog
  82
+        ;;
  83
+    try-restart|condrestart)
  84
+        if status $prog >/dev/null ; then
  85
+            restart
  86
+        fi
  87
+	;;
  88
+    reload)
  89
+        # If config can be reloaded without restarting, implement it here,
  90
+        # remove the "exit", and add "reload" to the usage message below.
  91
+        # For example:
  92
+        # status $prog >/dev/null || exit 7
  93
+        # killproc $prog -HUP
  94
+        action $"Service ${0##*/} does not support the reload action: " /bin/false
  95
+        exit 3
  96
+        ;;
  97
+    *)
  98
+        echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}"
  99
+        exit 2
  100
+esac
104  for_fedora/init.d/shinken-poller.init
... ...
@@ -0,0 +1,104 @@
  1
+#!/bin/sh
  2
+#
  3
+# shinken-poller - Startup script for the Shinken Poller Daemon
  4
+#
  5
+# chkconfig: 2345 20 80
  6
+# description:  Shinken is a monitoring tool and the Poller \
  7
+#               is one of its daemon. This one gets the \
  8
+#               configuration from the arbiter his purpose \ 
  9
+#               is to actually do the checks ordered by the \
  10
+#               schedulers, and then sends the results to \
  11
+#               the schedulers specified in the configuration \
  12
+
  13
+### BEGIN INIT INFO
  14
+# Provides:          shinken-poller
  15
+# Required-Start:    $all 
  16
+# Required-Stop:     $all
  17
+# Should-Start: 
  18
+# Should-Stop: 
  19
+# Default-Start:     2 3 4 5 
  20
+# Default-Stop:      0 1 6
  21
+# Short-Description: Shinken poller daemon
  22
+# Description:     Shinken is a monitoring tool and the Poller 
  23
+#                  is one of its daemon. This one gets the 
  24
+#                  configuration from the arbiter his purpose  
  25
+#                  is to actually do the checks ordered by the 
  26
+#                  schedulers, and then sends the results to 
  27
+#                  the schedulers specified in the configuration 
  28
+
  29
+### END INIT INFO
  30
+
  31
+
  32
+
  33
+# Source function library.
  34
+. /etc/rc.d/init.d/functions
  35
+
  36
+
  37
+daemon_args="-d -c /etc/shinken/pollerd.ini"             # Arguments to run the daemon with
  38
+pidfile=/var/run/shinken/pollerd.pid
  39
+
  40
+exec="/usr/sbin/shinken-poller"
  41
+prog=$(basename $exec)
  42
+
  43
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
  44
+
  45
+lockfile=/var/lock/subsys/$prog
  46
+
  47
+start() {
  48
+
  49
+    directory=$(dirname $pidfile)                                                                                                                                    
  50
+    [ ! -d $directory ] && mkdir -p $directory
  51
+    chown nagios:root $directory
  52
+
  53
+    echo -n $"Starting $prog: "
  54
+    $exec $daemon_args
  55
+    # if not running, start it up here, usually something like "daemon $exec"
  56
+    retval=$?
  57
+    echo
  58
+    [ $retval -eq 0 ] && touch $lockfile
  59
+    return $retval
  60
+}
  61
+
  62
+stop() {
  63
+    echo -n $"Stopping $prog: "
  64
+    killproc -p ${pidfile}
  65
+    # stop it here, often "killproc $prog"
  66
+    retval=$?
  67
+    echo
  68
+    [ $retval -eq 0 ] && rm -f $lockfile
  69
+    return $retval
  70
+}
  71
+
  72
+restart() {
  73
+    stop
  74
+    start
  75
+}
  76
+
  77
+case "$1" in
  78
+    start|stop|restart)
  79
+        $1
  80
+        ;;
  81
+    force-reload)
  82
+        restart
  83
+        ;;
  84
+    status)
  85
+        status $prog
  86
+        ;;
  87
+    try-restart|condrestart)
  88
+        if status $prog >/dev/null ; then
  89
+            restart
  90
+        fi
  91
+	;;
  92
+    reload)
  93
+        # If config can be reloaded without restarting, implement it here,
  94
+        # remove the "exit", and add "reload" to the usage message below.
  95
+        # For example:
  96
+        # status $prog >/dev/null || exit 7
  97
+        # killproc $prog -HUP
  98
+        action $"Service ${0##*/} does not support the reload action: " /bin/false
  99
+        exit 3
  100
+        ;;
  101
+    *)
  102
+        echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}"
  103
+        exit 2
  104
+esac
100  for_fedora/init.d/shinken-reactionner.init
... ...
@@ -0,0 +1,100 @@
  1
+#!/bin/sh
  2
+#
  3
+# shinken-reactionner - Startup script for the Shinken Reactionner Daemon
  4
+#
  5
+# chkconfig: 2345 20 80
  6
+# description:  Shinken is a monitoring tool and the Reactionner \
  7
+#               is one of its daemon. This one gets the configuration \
  8
+#		from the arbiter His purpose is to get the actually \
  9
+#		do the actions like sending an email ordered by the \
  10
+#		schedulers specified in the configuration. \
  11
+
  12
+### BEGIN INIT INFO
  13
+# Provides:          shinken-reactionner
  14
+# Required-Start:    $all 
  15
+# Required-Stop:     $all
  16
+# Should-Start:    
  17
+# Should-Stop: 
  18
+# Default-Start:     2 3 4 5 
  19
+# Default-Stop:      0 1 6
  20
+# Short-Description: Shinken reactionner daemon
  21
+# Description:       Shinken is a monitoring tool and the Reactionner
  22
+#                    is one of its daemon. This one gets the configuration from the arbiter
  23
+#                    His purpose is to get the actually do the actions like sending an email
  24
+#                    ordered by the schedulers specified in the configuration
  25
+### END INIT INFO
  26
+
  27
+
  28
+
  29
+# Source function library.
  30
+. /etc/rc.d/init.d/functions
  31
+
  32
+
  33
+daemon_args="-d -c /etc/shinken/reactionnerd.ini"             # Arguments to run the daemon with
  34
+pidfile=/var/run/shinken/reactionnerd.pid
  35
+
  36
+exec="/usr/sbin/shinken-reactionner"
  37
+prog=$(basename $exec)
  38
+
  39
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
  40
+
  41
+lockfile=/var/lock/subsys/$prog
  42
+
  43
+start() {
  44
+
  45
+    directory=$(dirname $pidfile)                                                                                                                                    
  46
+    [ ! -d $directory ] && mkdir -p $directory
  47
+    chown nagios:root $directory
  48
+
  49
+    echo -n $"Starting $prog: "
  50
+    $exec $daemon_args
  51
+    # if not running, start it up here, usually something like "daemon $exec"
  52
+    retval=$?
  53
+    echo
  54
+    [ $retval -eq 0 ] && touch $lockfile
  55
+    return $retval
  56
+}
  57
+
  58
+stop() {
  59
+    echo -n $"Stopping $prog: "
  60
+    killproc -p ${pidfile}
  61
+    # stop it here, often "killproc $prog"
  62
+    retval=$?
  63
+    echo
  64
+    [ $retval -eq 0 ] && rm -f $lockfile
  65
+    return $retval
  66
+}
  67
+
  68
+restart() {
  69
+    stop
  70
+    start
  71
+}
  72
+
  73
+case "$1" in
  74
+    start|stop|restart)
  75
+        $1
  76
+        ;;
  77
+    force-reload)
  78
+        restart
  79
+        ;;
  80
+    status)
  81
+        status $prog
  82
+        ;;
  83
+    try-restart|condrestart)
  84
+        if status $prog >/dev/null ; then
  85
+            restart
  86
+        fi
  87
+	;;
  88
+    reload)
  89
+        # If config can be reloaded without restarting, implement it here,
  90
+        # remove the "exit", and add "reload" to the usage message below.
  91
+        # For example:
  92
+        # status $prog >/dev/null || exit 7
  93
+        # killproc $prog -HUP
  94
+        action $"Service ${0##*/} does not support the reload action: " /bin/false
  95
+        exit 3
  96
+        ;;
  97
+    *)
  98
+        echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}"
  99
+        exit 2
  100
+esac
99  for_fedora/init.d/shinken-receiver.init
... ...
@@ -0,0 +1,99 @@
  1
+#!/bin/sh
  2
+#
  3
+# shinken-receiver - Startup script for the Shinken Receiver Daemon
  4
+#
  5
+# chkconfig: 2345 20 80
  6
+# description:  Shinken is a monitoring tool and the Receiver \
  7
+#               is one of its daemon. This one gets the configuration \
  8
+#               from the arbiter His purpose is to get the broks from \
  9
+#               the schedulers specified in the configuration.
  10
+
  11
+### BEGIN INIT INFO
  12
+# Provides:          shinken-receiver
  13
+# Required-Start:    $all 
  14
+# Required-Stop:     $all
  15
+# Should-Start:    
  16
+# Should-Stop: 
  17
+# Default-Start:     2 3 4 5 
  18
+# Default-Stop:      0 1 6
  19
+# Short-Description: Shinken receiver daemon
  20
+# Description:       Shinken is a monitoring tool and the Receiver
  21
+#                    is one of its daemon. This one gets the configuration from the arbiter
  22
+#                    His purpose is to get the broks from the schedulers specified in the
  23
+#                    configuration
  24
+### END INIT INFO
  25
+
  26
+
  27
+
  28
+# Source function library.
  29
+. /etc/rc.d/init.d/functions
  30
+
  31
+
  32
+daemon_args="-d -c /etc/shinken/receiverd.ini"             # Arguments to run the daemon with
  33
+pidfile=/var/run/shinken/receiverd.pid
  34
+
  35
+exec="/usr/sbin/shinken-receiver"
  36
+prog=$(basename $exec)
  37
+
  38
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
  39
+
  40
+lockfile=/var/lock/subsys/$prog
  41
+
  42
+start() {
  43
+
  44
+    directory=$(dirname $pidfile)                                                                                                                                    
  45
+    [ ! -d $directory ] && mkdir -p $directory
  46
+    chown nagios:root $directory
  47
+
  48
+    echo -n $"Starting $prog: "
  49
+    $exec $daemon_args
  50
+    # if not running, start it up here, usually something like "daemon $exec"
  51
+    retval=$?
  52
+    echo
  53
+    [ $retval -eq 0 ] && touch $lockfile
  54
+    return $retval
  55
+}
  56
+
  57
+stop() {
  58
+    echo -n $"Stopping $prog: "
  59
+    killproc -p ${pidfile}
  60
+    # stop it here, often "killproc $prog"
  61
+    retval=$?
  62
+    echo
  63
+    [ $retval -eq 0 ] && rm -f $lockfile
  64
+    return $retval
  65
+}
  66
+
  67
+restart() {
  68
+    stop
  69
+    start
  70
+}
  71
+
  72
+case "$1" in
  73
+    start|stop|restart)
  74
+        $1
  75
+        ;;
  76
+    force-reload)
  77
+        restart
  78
+        ;;
  79
+    status)
  80
+        status $prog
  81
+        ;;
  82
+    try-restart|condrestart)
  83
+        if status $prog >/dev/null ; then
  84
+            restart
  85
+        fi
  86
+	;;
  87
+    reload)
  88
+        # If config can be reloaded without restarting, implement it here,
  89
+        # remove the "exit", and add "reload" to the usage message below.
  90
+        # For example:
  91
+        # status $prog >/dev/null || exit 7
  92
+        # killproc $prog -HUP
  93
+        action $"Service ${0##*/} does not support the reload action: " /bin/false
  94
+        exit 3
  95
+        ;;
  96
+    *)
  97
+        echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}"
  98
+        exit 2
  99
+esac
100  for_fedora/init.d/shinken-scheduler.init
... ...
@@ -0,0 +1,100 @@
  1
+#!/bin/sh
  2
+#
  3
+# shinken-scheduler - Startup script for the Shinken Scheduler Daemon
  4
+#
  5
+# chkconfig: 2345 20 80
  6
+# description:  Shinken is a monitoring tool and the Scheduler \
  7
+#               is one of its daemon. This one get configuration \
  8
+#		from the arbiter His purpose is only to schedule \
  9
+#		do the checks and actions specified in the \
  10
+#		configuration received from the arbiter. 
  11
+
  12
+### BEGIN INIT INFO
  13
+# Provides:          shinken-scheduler
  14
+# Required-Start:    $all 
  15
+# Required-Stop:     $all
  16
+# Should-Start:    
  17
+# Should-Stop: 
  18
+# Default-Start:     2 3 4 5 
  19
+# Default-Stop:      0 1 6
  20
+# Short-Description: Shinken scheduler daemon
  21
+# Description:       Shinken is a monitoring tool and the Scheduler
  22
+#                    is one of its daemon. This one get configuration from the arbiter
  23
+#                    His purpose is only to schedule do the checks and actions specified
  24
+#                    in the configuration received from the arbiter
  25
+### END INIT INFO
  26
+
  27
+
  28
+
  29
+# Source function library.
  30
+. /etc/rc.d/init.d/functions
  31
+
  32
+
  33
+daemon_args="-d -c /etc/shinken/schedulerd.ini"             # Arguments to run the daemon with
  34
+pidfile=/var/run/shinken/schedulerd.pid
  35
+
  36
+exec="/usr/sbin/shinken-scheduler"
  37
+prog=$(basename $exec)
  38
+
  39
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
  40
+
  41
+lockfile=/var/lock/subsys/$prog
  42
+
  43
+start() {
  44
+
  45
+    directory=$(dirname $pidfile)                                                                                                                                    
  46
+    [ ! -d $directory ] && mkdir -p $directory
  47
+    chown nagios:root $directory
  48
+
  49
+    echo -n $"Starting $prog: "
  50
+    $exec $daemon_args
  51
+    # if not running, start it up here, usually something like "daemon $exec"
  52
+    retval=$?
  53
+    echo
  54
+    [ $retval -eq 0 ] && touch $lockfile
  55
+    return $retval
  56
+}
  57
+
  58
+stop() {
  59
+    echo -n $"Stopping $prog: "
  60
+    killproc -p ${pidfile}
  61
+    # stop it here, often "killproc $prog"
  62
+    retval=$?
  63
+    echo
  64
+    [ $retval -eq 0 ] && rm -f $lockfile
  65
+    return $retval
  66
+}
  67
+
  68
+restart() {
  69
+    stop
  70
+    start
  71
+}
  72
+
  73
+case "$1" in
  74
+    start|stop|restart)
  75
+        $1
  76
+        ;;
  77
+    force-reload)
  78
+        restart
  79
+        ;;
  80
+    status)
  81
+        status $prog
  82
+        ;;
  83
+    try-restart|condrestart)
  84
+        if status $prog >/dev/null ; then
  85
+            restart
  86
+        fi
  87
+	;;
  88
+    reload)
  89
+        # If config can be reloaded without restarting, implement it here,
  90
+        # remove the "exit", and add "reload" to the usage message below.
  91
+        # For example:
  92
+        # status $prog >/dev/null || exit 7
  93
+        # killproc $prog -HUP
  94
+        action $"Service ${0##*/} does not support the reload action: " /bin/false
  95
+        exit 3
  96
+        ;;
  97
+    *)
  98
+        echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}"
  99
+        exit 2
  100
+esac
14  install
@@ -381,18 +381,20 @@ function prerequisites(){
381 381
                         cecho " > $EPELPKG already installed" green
382 382
                     fi
383 383
                     ;;
384  
-#                6)
385  
-#                    PACKAGES=$YUMPKGS
386  
-#                    QUERY="rpm -q "
387  
-#                    ;;
388  
-        ;;
  384
+                *)                    
  385
+                    cecho " > Unsupported RedHat/CentOs version" red
  386
+                    exit 2
  387
+                    ;;
  388
+            esac
  389
+            ;;
389 390
         Fedora)
  391
+            case $VERS in
390 392
                 16|17)
391 393
                     PACKAGES=$YUMPKGS
392 394
                     QUERY="rpm -q "
393 395
                     ;;
394 396
                 *)
395  
-                    cecho " > Unsupported RedHat/CentOs version" red
  397
+                    cecho " > Unsupported Fedora version" red
396 398
                     exit 2
397 399
                     ;;
398 400
             esac

0 notes on commit 38dd6f9

Please sign in to comment.
Something went wrong with that request. Please try again.