]> git.pld-linux.org Git - packages/corosync.git/commitdiff
PLD init scripts added
authorJacek Konieczny <jajcus@pld-linux.org>
Tue, 3 Jul 2012 21:24:22 +0000 (21:24 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    corosync-notifyd.init -> 1.1
    corosync-notifyd.sysconfig -> 1.1
    corosync.init -> 1.1

corosync-notifyd.init [new file with mode: 0644]
corosync-notifyd.sysconfig [new file with mode: 0644]
corosync.init [new file with mode: 0644]

diff --git a/corosync-notifyd.init b/corosync-notifyd.init
new file mode 100644 (file)
index 0000000..ff08b48
--- /dev/null
@@ -0,0 +1,113 @@
+#!/bin/sh
+#
+# corosync-notifyd     Corosync Dbus and snmp notifier
+#
+# chkconfig: 2345 23 77
+# description: Corosync Dbus and snmp notifier
+# processname: corosync-notifyd-notifyd
+#
+### BEGIN INIT INFO
+# Provides:            corosync-notifyd-notifyd
+# Required-Start:      $corosync-notifyd $cman
+# Required-Stop:       $corosync-notifyd $cman
+# Default-Start:
+# Default-Stop:
+# Short-Description:   Starts and stops Corosync Notifier.
+# Description:         Starts and stops Corosync Notifier.
+### END INIT INFO
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+SEND_SNMP_TRAPS=no
+SEND_DBUS_SIGNALS=yes
+LOG_ALL_EVENTS=no
+
+[ -f /etc/sysconfig/corosync-notifyd ] && . /etc/sysconfig/corosync-notifyd
+
+start() {
+       # Check if the service is already running?
+       if [ -f /var/lock/subsys/corosync-notifyd ]; then
+               msg_already_running "Corosync Notifier"
+               return
+       fi
+       if [ -f /var/lock/subsys/openais ]; then
+               msg_already_running "Corosync Notifier (as openais)"
+               return
+       fi
+       if grep -q nocluster /proc/cmdline ; then
+               show "Disabled on boot"
+               RETVAL=1
+               return
+       fi
+
+       local options=""
+       if is_yes "$SEND_SNMP_TRAPS" ; then
+               options="$options -s"
+       fi
+       if [ -n "$SNMP_MANAGER" ] ; then
+               options="$options -m $SNMP_MANAGER"
+       fi
+       if is_yes "$SEND_DBUS_SIGNALS" ; then
+               options="$options -d"
+       fi
+       if is_yes "$LOG_ALL_EVENTS" ; then
+               options="$options -l"
+       fi
+       msg_starting "Corosync Notifier"
+       daemon /usr/sbin/corosync-notifyd "$options"
+       RETVAL=$?
+       [ $RETVAL -eq 0 ] && touch /var/lock/subsys/corosync-notifyd
+}
+
+stop() {
+       if [ ! -f /var/lock/subsys/corosync-notifyd ]; then
+               msg_not_running "Corosync Notifier"
+               return
+       fi
+
+       # Stop daemons.
+       msg_stopping "Corosync Notifier"
+       killproc /usr/sbin/corosync-notifyd
+       rm -f /var/lock/subsys/corosync-notifyd
+}
+
+condrestart() {
+       if [ ! -f /var/lock/subsys/corosync-notifyd ]; then
+               msg_not_running "Corosync Notifier"
+               RETVAL=$1
+               return
+       fi
+
+       stop
+       start
+}
+
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
+       ;;
+  restart)
+       stop
+       sleep 5
+       start
+       ;;
+  try-restart)
+       condrestart 0
+       ;;
+  force-reload)
+       condrestart 7
+       ;;
+  status)
+       status corosync-notifyd
+       RETVAL=$?
+       ;;
+*)
+       msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
+       exit 3
+       ;;
+esac
+exit $RETVAL
diff --git a/corosync-notifyd.sysconfig b/corosync-notifyd.sysconfig
new file mode 100644 (file)
index 0000000..c40c6df
--- /dev/null
@@ -0,0 +1,12 @@
+
+# Send SNMP traps on all events.
+SEND_SNMP_TRAPS=no
+
+# SNMP Manager IP address (defaults to localhost).
+#SNMP_MANAGER=
+
+# Send DBUS signals on all events.
+SEND_DBUS_SIGNALS=yes
+
+# Log all events.
+LOG_ALL_EVENTS=no
diff --git a/corosync.init b/corosync.init
new file mode 100644 (file)
index 0000000..109f8db
--- /dev/null
@@ -0,0 +1,96 @@
+#!/bin/sh
+#
+# corosync     Corosync Cluster Engine
+#
+# chkconfig: 2345 21 79
+# description: Corosync Cluster Engine
+# processname: corosync
+#
+### BEGIN INIT INFO
+# Provides:            corosync
+# Required-Start:      $network $syslog
+# Required-Stop:       $network $syslog
+# Default-Start:
+# Default-Stop:
+# Short-Description:   Starts and stops Corosync Cluster Engine.
+# Description:         Starts and stops Corosync Cluster Engine.
+### END INIT INFO
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+[ -f /etc/sysconfig/corosync ] && . /etc/sysconfig/corosync
+
+start() {
+       # Check if the service is already running?
+       if [ -f /var/lock/subsys/corosync ]; then
+               msg_already_running "Corosync Cluster Engine"
+               return
+       fi
+       if [ -f /var/lock/subsys/openais ]; then
+               msg_already_running "Corosync Cluster Engine (as openais)"
+               return
+       fi
+       if grep -q nocluster /proc/cmdline ; then
+               show "Disabled on boot"
+               RETVAL=1
+               return
+       fi
+
+       msg_starting "Corosync Cluster Engine"
+       daemon /usr/sbin/corosync
+       RETVAL=$?
+       [ $RETVAL -eq 0 ] && touch /var/lock/subsys/corosync
+}
+
+stop() {
+       if [ ! -f /var/lock/subsys/corosync ]; then
+               msg_not_running "Corosync Cluster Engine"
+               return
+       fi
+
+       # Stop daemons.
+       msg_stopping "Corosync Cluster Engine"
+       killproc /usr/sbin/corosync
+       rm -f /var/lock/subsys/corosync
+}
+
+condrestart() {
+       if [ ! -f /var/lock/subsys/corosync ]; then
+               msg_not_running "Corosync Cluster Engine"
+               RETVAL=$1
+               return
+       fi
+
+       stop
+       start
+}
+
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
+       ;;
+  restart)
+       stop
+       sleep 5
+       start
+       ;;
+  try-restart)
+       condrestart 0
+       ;;
+  force-reload)
+       condrestart 7
+       ;;
+  status)
+       status corosync
+       RETVAL=$?
+       ;;
+*)
+       msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
+       exit 3
+       ;;
+esac
+exit $RETVAL
This page took 0.07928 seconds and 4 git commands to generate.