From 128966821f9d92cc8912c7b23e39c16910caa554 Mon Sep 17 00:00:00 2001 From: Vladimir Sorokin Date: Wed, 29 Sep 2010 15:20:42 +0400 Subject: [PATCH] corosync: fix init script Allows to get status from init script when no corosync.cfg exists. Signed-off-by: Vladimir Sorokin Signed-off-by: Roman I Khimov --- recipes/corosync/corosync_1.2.8.bb | 2 +- recipes/corosync/files/init | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/recipes/corosync/corosync_1.2.8.bb b/recipes/corosync/corosync_1.2.8.bb index c3e4290009..4b35ac5101 100644 --- a/recipes/corosync/corosync_1.2.8.bb +++ b/recipes/corosync/corosync_1.2.8.bb @@ -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 \ diff --git a/recipes/corosync/files/init b/recipes/corosync/files/init index 7277ca905b..6b397e502f 100644 --- a/recipes/corosync/files/init +++ b/recipes/corosync/files/init @@ -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 } -- 2.39.5