Search
j0ke.net Open Build Service
>
Projects
>
GFS
:
experimental
>
corosync
> corosync.init
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File corosync.init of Package corosync
#!/bin/sh # # corosync Start the Corosync Cluster Engine # # Author: Andrew Beekhof <abeekhof@suse.de> # License: Revised BSD # # chkconfig: - 20 20 # processname: corosync # description: Corosync Cluster Engine # ### BEGIN INIT INFO # Description: corosync.... # # Short-Description: Corosync Cluster Engine. # 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" . /etc/rc.status 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 Corosync Cluster Engine ($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=0 stop() { echo -n $"Stopping Corosync Cluster Engine ($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 } rc_reset case "$1" in start|stop|restart) $1 rc_status -v ;; force-stop) do_force=1 stop rc_status -v ;; reload|force-reload) restart rc_status -v ;; condrestart|try-restart) [ ! -f "$lockfile" ] || restart rc_status -v ;; status) status $prog rc_status -v ;; *) echo $"Usage: $0 {start|stop|restart|try-restart|condrestart|reload|force-reload|force-stop|status}" exit 2 esac rc_exit