rpms/OpenIPMI/devel OpenIPMI.spec, 1.13, 1.14 openipmi.initscript, 1.6, 1.7

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Tue Oct 11 12:43:04 UTC 2005


Author: pknirsch

Update of /cvs/dist/rpms/OpenIPMI/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv21508

Modified Files:
	OpenIPMI.spec openipmi.initscript 
Log Message:
- Updated initscript to fix missing redhat-lsb bug (#169901)



Index: OpenIPMI.spec
===================================================================
RCS file: /cvs/dist/rpms/OpenIPMI/devel/OpenIPMI.spec,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- OpenIPMI.spec	8 Sep 2005 11:25:11 -0000	1.13
+++ OpenIPMI.spec	11 Oct 2005 12:43:00 -0000	1.14
@@ -2,7 +2,7 @@
 Summary: OpenIPMI (Intelligent Platform Management Interface) library and tools
 Name: OpenIPMI
 Version: 1.4.14
-Release: 9
+Release: 10
 License: GPL
 Group: System Environment/Base
 URL: http://sourceforge.net/projects/openipmi/
@@ -124,6 +124,9 @@
 %{_libdir}/*.a
 
 %changelog
+* Tue Oct 11 2005 Phil Knirsch <pknirsch at redhat.com> 1.4.14-10
+- Updated initscript to fix missing redhat-lsb bug (#169901)
+
 * Thu Sep 08 2005 Phil Knirsch <pknirsch at redhat.com> 1.4.14-9
 - Another update to latest initscripts from Dell
 - Fixed some missing return statements for non-void functions (#164138)


Index: openipmi.initscript
===================================================================
RCS file: /cvs/dist/rpms/OpenIPMI/devel/openipmi.initscript,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- openipmi.initscript	8 Sep 2005 11:25:11 -0000	1.6
+++ openipmi.initscript	11 Oct 2005 12:43:00 -0000	1.7
@@ -31,7 +31,50 @@
 #
 #############################################################################
 # for log_success_msg and friends
-[ -r /lib/lsb/init-functions ] && . /lib/lsb/init-functions
+if [ -r /lib/lsb/init-functions ]; then
+# LSB, SLES, ...
+    . /lib/lsb/init-functions
+elif [ -r /etc/init.d/functions ]; then
+# Red Hat / VMware
+    . /etc/init.d/functions
+    my_log_message()
+    {
+	ACTION=$1
+	shift
+	
+	case "$ACTION" in
+	    success)
+		echo -n $*
+		success "$*"
+		echo
+		;;
+	    failure)
+		echo -n $*
+		failure "$*"
+		echo
+		;;
+	    warning)
+		echo -n $*
+		warning "$*"
+		echo
+		;;
+	    *)
+		;;
+	esac
+    }
+    log_success_msg()
+    {
+	my_log_message success "$*"
+    }
+    log_failure_msg()
+    {
+	my_log_message failure "$*"
+    }
+    log_warning_msg()
+    {
+	my_log_message warning "$*"
+    }
+fi
 
 CONFIGFILE=/etc/sysconfig/ipmi
 # source config info
@@ -225,7 +268,12 @@
 {
 	local poweroff_opts=""
 	load_hw_modules
-	[ "${IPMI_POWERCYCLE}" == "1" ] && poweroff_opts="poweroff_control=2"
+	if [ "${IPMI_POWERCYCLE}" == "1" ]; then
+	    modinfo ipmi_poweroff 2>/dev/null | grep poweroff_control > /dev/null 2>&1 && \
+		poweroff_opts="poweroff_control=2"
+	    modinfo ipmi_poweroff 2>/dev/null | grep poweroff_powercycle > /dev/null 2>&1 && \
+		poweroff_opts="poweroff_powercycle=1"
+	fi
 	modprobe ipmi_poweroff "${poweroff_opts}" > /dev/null 2>&1
 	modules_loaded ipmi_poweroff
 	[ ${OnePlusUnloaded} -ne 0 ] &&
@@ -290,7 +338,7 @@
 	for m in ${MODULES_INTERFACES}; do
 		modprobe -q -r ${m} > /dev/null 2>&1
 	done
-	lsmod | egrep -q "ipmi_(poweroff|watchdog)"
+	lsmod | egrep -q "ipmi_(poweroff|watchdog)" > /dev/null 2>&1
 	if [ "$?" -ne "0" ]; then
 		stop_watchdog_quiet
 		stop_powercontrol_quiet




More information about the fedora-cvs-commits mailing list