[nut/el6] fix return code from init script (#962937)

Michal Hlavinka mhlavink at fedoraproject.org
Wed May 15 13:58:15 UTC 2013


commit 6b10ec022394629689724cf153f48fe6268500d1
Author: Michal Hlavinka <mhlavink at redhat.com>
Date:   Wed May 15 15:58:09 2013 +0200

    fix return code from init script (#962937)

 nut.spec |    5 ++++-
 ups.init |    6 +++++-
 2 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/nut.spec b/nut.spec
index 467735d..65f4c5a 100644
--- a/nut.spec
+++ b/nut.spec
@@ -13,7 +13,7 @@
 Summary: Network UPS Tools
 Name: nut
 Version: 2.6.5
-Release: 1%{?dist}
+Release: 2%{?dist}
 Group: Applications/System
 License: GPLv2+
 Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -382,6 +382,9 @@ rm -rf %{buildroot}
 %{_libdir}/pkgconfig/libnutscan.pc
 
 %changelog
+* Wed May 15 2013 Michal Hlavinka <mhlavink at redhat.com> - 2.6.5-2
+- fix return code from init script (#962937)
+
 * Fri Aug 10 2012 Michal Hlavinka <mhlavink at redhat.com> - 2.6.5-1
 - updated to 2.6.5
 
diff --git a/ups.init b/ups.init
index 1fe9449..9e56429 100644
--- a/ups.init
+++ b/ups.init
@@ -59,6 +59,7 @@ start() {
 	else
 		echo -n $"Starting UPS monitor (slave): "
 		daemon /usr/sbin/upsmon > /dev/null 2>&1 && success || failure
+		RETVAL=$?
 		echo
 	fi
 
@@ -68,13 +69,16 @@ start() {
 stop() {
 	echo -n $"Stopping UPS monitor: "
 	killproc upsmon
+	RETVAL=$?
 	echo
 
 	if [ "$SERVER" = "yes" ]; then
 		prog="upsd"
 		echo -n $"Stopping $prog: "
 		killproc upsd > /dev/null 2>&1 && success || failure
-		RETVAL=$?
+		if [ "$RETVAL" = 0 ]; then
+			RETVAL=$?
+		fi
 		echo
 
 		echo -n $"Shutting down upsdrvctl: "


More information about the scm-commits mailing list