corosync: fix init script
authorVladimir Sorokin <sorokin@altell.ru>
Wed, 29 Sep 2010 11:20:42 +0000 (15:20 +0400)
committerRoman I Khimov <khimov@altell.ru>
Thu, 30 Sep 2010 19:51:39 +0000 (23:51 +0400)
Allows to get status from init script when no corosync.cfg exists.

Signed-off-by: Vladimir Sorokin <sorokin@altell.ru>
Signed-off-by: Roman I Khimov <khimov@altell.ru>
recipes/corosync/corosync_1.2.8.bb
recipes/corosync/files/init

index c3e4290..4b35ac5 100644 (file)
@@ -2,7 +2,7 @@ DESCRIPTION = "OSI Certified implementation of a complete cluster engine"
 LICENSE = "BSD"
 DEPENDS = "groff-native"
 
-PR = "r0"
+PR = "r1"
 
 SRC_URI = " \
        ftp://ftp@corosync.org/downloads/corosync-${PV}/corosync-${PV}.tar.gz \
index 7277ca9..6b397e5 100644 (file)
@@ -26,11 +26,6 @@ prog="corosync"
 lockfile="/var/lock/subsys/$prog"
 configfile="/etc/corosync/corosync.conf"
 
-if [ ! -f "$configfile" ]; then
-       echo "Error: corosync is not configured ($configfile missing)"
-       exit 1
-fi
-
 internal_status() {
     killall -0 corosync > /dev/null 2>&1
     return $?
@@ -49,6 +44,11 @@ status() {
 }
 
 start() {
+    if [ ! -f "$configfile" ]; then
+       echo "Error: corosync is not configured ($configfile missing)"
+       exit 1
+    fi
+
     echo -n $"Starting Corosync Cluster Engine ($prog): "
     if
        ! internal_status
@@ -128,6 +128,11 @@ stop() {
 }
 
 restart() {
+    if [ ! -f "$configfile" ]; then
+       echo "Error: corosync is not configured ($configfile missing)"
+       exit 1
+    fi
+
     stop
     start
 }