[PATCH] cman/init.d/cman.in: don't assume chkconfig exists

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
attached patch makes sure we don't rely on chkconffig (which doesn't
exist on Debian based distros). It also checks additionally for
network-manager since this is the name of the service on Debian/Ubuntu.
Cheers,
 -- Guido
>From 1302e57385c8cd178f23ca740e67b8b350efe8e9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx@xxxxxxxxxxx>
Date: Wed, 10 Mar 2010 22:24:42 +0100
Subject: [PATCH] Don't rely on chkconfig and check for network-manager

as it's called on Debian based distros.
---
 cman/init.d/cman.in |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/cman/init.d/cman.in b/cman/init.d/cman.in
index e0281be..abaccb8 100644
--- a/cman/init.d/cman.in
+++ b/cman/init.d/cman.in
@@ -295,9 +295,14 @@ sshd_enabled()
 
 network_manager_enabled()
 {
+	if type chkconfig >/dev/null 2>&1 && chkconfig NetworkManager; then
+		errmsg="\nNetwork Manager is configured to run. Please disable it in the cluster."
+		return 1
+	fi
+
 	if status NetworkManager > /dev/null 2>&1 || \
-	   chkconfig NetworkManager; then
-		errmsg="\nNetwork Manager is either running or configured to run. Please disable it in the cluster."
+	   status network-manager > /dev/null; then
+		errmsg="\nNetwork Manager is running. Please disable it in the cluster."
 		return 1
 	fi
 	return 0
-- 
1.7.0

--
Linux-cluster mailing list
Linux-cluster@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/linux-cluster

[Index of Archives]     [Corosync Cluster Engine]     [GFS]     [Linux Virtualization]     [Centos Virtualization]     [Centos]     [Linux RAID]     [Fedora Users]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite Camping]

  Powered by Linux