Skip to content
This repository
Browse code

add init script for el6.

  • Loading branch information...
commit 0f0a081635cb8e5df23b6c48912cc46efa076bb5 1 parent 25d6358
hvad authored October 01, 2012
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

0 notes on commit 0f0a081

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