Page Menu
Home
ClusterLabs Projects
Search
Configure Global Search
Log In
Files
F3152164
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/init/generic.in b/init/generic.in
index 578fa191..273bd604 100755
--- a/init/generic.in
+++ b/init/generic.in
@@ -1,172 +1,172 @@
#!/bin/bash
# Authors:
# Andrew Beekhof <abeekhof@redhat.com>
# Fabio M. Di Nitto <fdinitto@redhat.com>
#
# License: Revised BSD
-# chkconfig: - 20 20
+# chkconfig: - 20 80
# description: Corosync Cluster Engine
# processname: corosync
#
### BEGIN INIT INFO
# Provides: corosync
# Required-Start: $network
# Should-Start: $syslog
# Required-Stop: $network
# Default-Start:
# Default-Stop:
# Short-Description: Starts and stops Corosync Cluster Engine.
# Description: Starts and stops Corosync Cluster Engine.
### END INIT INFO
desc="Corosync Cluster Engine"
prog="corosync"
# set secure PATH
PATH="/sbin:/bin:/usr/sbin:/usr/bin:@SBINDIR@"
success()
{
echo -ne "[ OK ]\r"
}
failure()
{
echo -ne "[FAILED]\r"
}
status()
{
pid=$(pidof $1 2>/dev/null)
rtrn=$?
if [ $rtrn -ne 0 ]; then
echo "$1 is stopped"
else
echo "$1 (pid $pid) is running..."
fi
return $rtrn
}
# rpm based distros
if [ -d @SYSCONFDIR@/sysconfig ]; then
[ -f @INITDDIR@/functions ] && . @INITDDIR@/functions
[ -f @SYSCONFDIR@/sysconfig/$prog ] && . @SYSCONFDIR@/sysconfig/$prog
[ -z "$LOCK_FILE" ] && LOCK_FILE="@LOCALSTATEDIR@/lock/subsys/$prog"
fi
# deb based distros
if [ -d @SYSCONFDIR@/default ]; then
[ -f @SYSCONFDIR@/default/$prog ] && . @SYSCONFDIR@/default/$prog
[ -z "$LOCK_FILE" ] && LOCK_FILE="@LOCALSTATEDIR@/lock/$prog"
fi
# The version of __pids_pidof in /etc/init.d/functions calls pidof with -x
# This means it matches scripts, including this one.
# Redefine it here so that status (from the same file) works.
# Otherwise simultaneous calls to stop() will loop forever
__pids_pidof() {
pidof -c -o $$ -o $PPID -o %PPID "$1" || \
pidof -c -o $$ -o $PPID -o %PPID "${1##*/}"
}
start()
{
echo -n "Starting $desc ($prog): "
# most recent distributions use tmpfs for @LOCALSTATEDIR@/run
# to avoid to clean it up on every boot.
# they also assume that init scripts will create
# required subdirectories for proper operations
mkdir -p @LOCALSTATEDIR@/run
if status $prog > /dev/null 2>&1; then
success
else
$prog > /dev/null 2>&1
# give it time to fail
sleep 2
if status $prog > /dev/null 2>&1; then
touch $LOCK_FILE
success
else
failure
rtrn=1
fi
fi
echo
}
executed_by_cman()
{
[ -f @LOCALSTATEDIR@/run/cman.pid ] || return 0
read cman_pid foo < @LOCALSTATEDIR@/run/cman.pid
if [ "$(pidof $prog)" == "$cman_pid" ];then
echo -n "$desc was executed by cman"
failure
echo
return 1
fi
return 0
}
stop()
{
! status $prog > /dev/null 2>&1 && return
! executed_by_cman && return
echo -n "Signaling $desc ($prog) to terminate: "
kill -TERM $(pidof $prog) > /dev/null 2>&1
success
echo
echo -n "Waiting for $prog services to unload:"
while status $prog > /dev/null 2>&1; do
sleep 1
echo -n "."
done
rm -f $LOCK_FILE
success
echo
}
restart()
{
stop
start
}
rtrn=0
case "$1" in
start)
start
;;
restart|reload|force-reload)
restart
;;
condrestart|try-restart)
if status $prog > /dev/null 2>&1; then
restart
fi
;;
status)
status $prog
rtrn=$?
;;
stop)
stop
;;
*)
echo "usage: $0 {start|stop|restart|reload|force-reload|condrestart|try-restart|status}"
rtrn=2
;;
esac
exit $rtrn
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Mon, Feb 24, 4:58 PM (2 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1464355
Default Alt Text
(3 KB)
Attached To
Mode
rC Corosync
Attached
Detach File
Event Timeline
Log In to Comment