[sheepdog] [PATCH 06/14] corosync: show better error messages

MORITA Kazutaka morita.kazutaka at gmail.com
Sat Aug 10 17:58:47 CEST 2013


From: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>

If cpg_initialize() returns CS_ERR_SECURITY, the error reason is sheep
doesn't have a privilege to use corosync because of corosync
configuration.  In this case, printing "Permission denied" is better.

In the other cases, corosync is actually running and there is another
error reason.  This removes "is corosync running?" from the error
message in the default cases.

Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 sheep/cluster/corosync.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sheep/cluster/corosync.c b/sheep/cluster/corosync.c
index 0bd3eb5..7166c11 100644
--- a/sheep/cluster/corosync.c
+++ b/sheep/cluster/corosync.c
@@ -735,9 +735,11 @@ again:
 		sd_debug("retry cpg_initialize");
 		usleep(200000);
 		goto again;
+	case CS_ERR_SECURITY:
+		sd_err("failed to initialize cpg - permission denied");
+		return -1;
 	default:
-		sd_err("failed to initialize cpg (%d) - is corosync running?",
-		       ret);
+		sd_err("failed to initialize cpg (%d)", ret);
 		return -1;
 	}
 
-- 
1.7.9.5



More information about the sheepdog mailing list