see patch.

Regards
-steve
Index: init/redhat
===================================================================
--- init/redhat	(revision 0)
+++ init/redhat	(revision 0)
@@ -0,0 +1,59 @@
+#!/bin/sh
+#
+# Corosync daemon init script for Red Hat Linux and compatibles.
+#
+# chkconfig: - 20 20
+# processname:  corosync
+# pidfile:      /var/run/corosync.pid
+# description:  OpenAIS
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+prog="corosync"
+exec="/usr/sbin/$prog"
+lockfile="/var/lock/subsys/$prog"
+
+[ -x "$exec" ] || exit 0
+
+start() {
+    echo -n $"Starting OpenAIS ($prog): "
+    export COROSYNC_DEFAULT_CONFIG_IFACE="openaisserviceenable:openaisparser"
+    daemon $exec
+    retval=$?
+    [ "$retval" -eq 0 ] && touch "$lockfile"
+    echo
+    return $retval
+}
+
+stop() {
+    echo -n $"Stopping OpenAIS ($prog): "
+    killproc $prog
+    retval=$?
+    [ "$retval" -eq 0 ] && rm -f "$lockfile"
+    echo
+    return $retval
+}
+
+restart() {
+    stop
+    start
+}
+
+case "$1" in
+    start|stop|restart)
+        $1
+        ;;
+    reload|force-reload)
+        restart
+        ;;
+    condrestart|try-restart)
+        [ ! -f "$lockfile" ] || restart
+        ;;
+    status)
+        status $prog
+        ;;
+    *)
+        echo $"Usage: $0 {start|stop|restart|try-restart|condrestart|reload|force-reload|status}"
+        exit 2
+esac

Property changes on: init/redhat
___________________________________________________________________
Name: svn:executable
   + *

Index: init/generic
===================================================================
--- init/generic	(revision 0)
+++ init/generic	(revision 0)
@@ -0,0 +1,145 @@
+#!/bin/sh
+#
+# corosync       Start the OpenAIS
+#
+# Author:       Andrew Beekhof <[EMAIL PROTECTED]>
+# License:      Revised BSD
+#
+# chkconfig: - 20 20
+# processname:  corosync
+# description:  OpenAIS
+#
+### BEGIN INIT INFO
+# Description: corosync....
+#
+# Short-Description: OpenAIS
+# Provides: corosync
+# Required-Start: $network
+# Should-Start: $syslog
+# Required-Stop: $network
+# Default-Start: 3 5
+# Default-Stop: 0 6
+### END INIT INFO
+
+do_force=0
+prog="corosync"
+lockfile="/var/lock/subsys/$prog"
+
+internal_status() {
+    killall -0 corosync > /dev/null 2>&1
+    return $?
+}
+
+status() {
+    if 
+	! internal_status
+    then
+	echo "Stopped"
+	return 7
+    fi
+
+    echo "Running"
+    return 0
+}
+
+start() {
+    echo -n $"Starting OpenAIS ($prog): "
+    if 
+	! internal_status
+    then
+	echo -n "starting... "
+	$prog 2>&1 > /dev/null 2>&1
+	echo -n "rc=$?: "
+    fi
+
+    sleep 2 # give it time to fail... $? isn't definitive
+
+    if 
+	internal_status
+    then
+	echo "OK"
+	return 0
+    fi
+
+    echo "Failed"
+    return 1
+}
+
+do_force=0
+do_forever=1
+
+stop() {
+    echo -n $"Stopping OpenAIS ($prog): "
+
+    killall -QUIT corosync
+
+    if [ $do_forever = 0 ]; then
+	for i in 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20; do
+	    if
+		internal_status
+	    then
+		sleep 2
+		echo -n "."
+	    else
+		rm -f "$lockfile"
+		echo "OK"
+		return 0
+	    fi
+	done
+
+	if [ $do_force = 1 ]; then
+	    echo -n "Escalating... "
+	    killall -KILL corosync
+	    sleep 5
+	    
+	    if
+		! internal_status
+	    then
+		rm -f "$lockfile"
+		echo "OK"
+		return 0
+	    fi
+	fi
+
+	echo "Failed"
+	return 1
+    fi
+
+    while 
+        internal_status
+    do
+	sleep 1
+	echo -n "."
+    done
+    
+    rm -f "$lockfile"
+    echo "OK"
+    return 0
+}
+
+restart() {
+    stop
+    start
+}
+
+case "$1" in
+    start|stop|restart)
+        $1
+        ;;
+    force-stop)
+	do_force=1
+        stop
+        ;;
+    reload|force-reload)
+        restart
+        ;;
+    condrestart|try-restart)
+        [ ! -f "$lockfile" ] || restart
+        ;;
+    status)
+        status $prog
+        ;;
+    *)
+        echo $"Usage: $0 {start|stop|restart|try-restart|condrestart|reload|force-reload|force-stop|status}"
+        exit 2
+esac

Property changes on: init/generic
___________________________________________________________________
Name: svn:executable
   + *

Index: init/mvlcge
===================================================================
--- init/mvlcge	(revision 0)
+++ init/mvlcge	(revision 0)
@@ -0,0 +1,29 @@
+#! /bin/sh
+#
+# Application Interface Specification Startup 
+# chkconfig: 2345 20 20
+
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+
+test -f /usr/sbin/corosync | exit 0
+
+case "$1" in 
+	start)
+ 		echo -n "Starting OpenAIS: " 
+		export COROSYNC_DEFAULT_CONFIG_IFACE="openaisserviceenable:openaisparser"
+		start-stop-daemon --start --quiet --exec /usr/sbin/corosync
+		echo "."
+
+		;;
+       	stop)
+		echo -n "Stopping OpenAIS: " 
+		start-stop-daemon --stop --quiet --exec /usr/sbin/corosync
+		echo "."
+               	;;
+       	*)
+               echo "Usage: /etc/init.d/openais {start|stop}" >&2
+               exit 1
+               ;;
+esac
+
+

Property changes on: init/mvlcge
___________________________________________________________________
Name: svn:executable
   + *

Index: init/README
===================================================================
--- init/README	(revision 0)
+++ init/README	(revision 0)
@@ -0,0 +1,5 @@
+This directory contains init scripts used to start and stop openais.
+
+redhat contains an init script for Red Hat systems.
+mvlcge contains an init script for MontaVista Linux systems.
+generic contains an init script for Generic Systems.
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to