Fix init scripts to be LSB compliant and return correct exit codes and provide mandatory actions

Resolves: #523169 #523177
This commit is contained in:
Jan Šafránek 2009-09-14 13:44:49 +00:00
parent 14cac2896f
commit 114475e629
2 changed files with 60 additions and 2 deletions

52
freeipmi-0.7.12-lsb.patch Normal file
View File

@ -0,0 +1,52 @@
523177: Initscript: ipmidetectd incorrect exit codes
523169: Initscript: ipmidetectd missing actions
Implement try-restart and force-reload actions.
Return correct exit codes.
diff -up freeipmi-0.7.12/ipmidetect/freeipmi-ipmidetectd.init.lsb freeipmi-0.7.12/ipmidetect/freeipmi-ipmidetectd.init
--- freeipmi-0.7.12/ipmidetect/freeipmi-ipmidetectd.init.lsb 2007-12-14 20:16:25.000000000 +0100
+++ freeipmi-0.7.12/ipmidetect/freeipmi-ipmidetectd.init 2009-09-14 15:38:12.000000000 +0200
@@ -14,6 +14,7 @@
### END INIT INFO
IPMIDETECTD=/usr/sbin/ipmidetectd
+IPMIDETECTD_CFG=/etc/ipmidetectd.cfg
[ -f $IPMIDETECTD ] || exit 1
@@ -21,6 +22,11 @@ IPMIDETECTD=/usr/sbin/ipmidetectd
if [ -f /etc/rc.d/init.d/functions ] ; then
. /etc/rc.d/init.d/functions
Xstart() {
+ if [ ! -f IPMIDETECTD_CFG ] ; then
+ failure; echo
+ RETVAL=6
+ return
+ fi
daemon $IPMIDETECTD
RETVAL=$?
echo
@@ -89,7 +95,7 @@ case "$1" in
echo -n "Shutting down ipmidetectd: "
Xstop
;;
- restart|reload)
+ restart|force-reload)
$0 stop
$0 start
RETVAL=$?
@@ -97,10 +103,11 @@ case "$1" in
status)
Xstatus
;;
- condrestart)
+ condrestart|try-restart)
Xcondrestart
;;
*)
- echo "Usage: $0 {start|stop|restart|status|condrestart}"
+ echo "Usage: $0 {start|stop|restart|status|condrestart|force-reload|try-restart}"
exit 1
esac
+exit $RETVAL

View File

@ -2,7 +2,7 @@
# Copyright (c) 2003 FreeIPMI Core Team
#
Release: 2%{?dist}
Release: 3%{?dist}
Name: freeipmi
Version: 0.7.12
@ -14,6 +14,7 @@ Patch1: freeipmi-0.5.1-regex.patch
Patch2: freeipmi-0.6.4-silent.patch
Patch3: freeipmi-0.6.4-argmax.patch
Patch4: freeipmi-0.6.4-pathsep.patch
Patch5: freeipmi-0.7.12-lsb.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: libgcrypt-devel texinfo
Requires(pre): chkconfig
@ -68,6 +69,7 @@ Provides a tool and a daemon for IPMI node detection.
%patch2 -p1 -b .silent
%patch3 -p1 -b .argmax
%patch4 -p1 -b .pathsep
%patch5 -p1 -b .lsb
%build
export CFLAGS="-D_GNU_SOURCE $RPM_OPT_FLAGS"
@ -291,7 +293,11 @@ fi
%{_mandir}/man8/ipmidetectd.8*
%changelog
* Wed Sep 9 2009 Jan Safranek <jsafrane@redhat.com> - 0.7.12
* Mon Sep 14 2009 Jan Safranek <jsafrane@redhat.com> - 0.7.12-2
- Fix init scripts to be LSB compliant and return correct exit codes
and provide mandatory actions (#523169, #523177)
* Wed Sep 9 2009 Jan Safranek <jsafrane@redhat.com> - 0.7.12-2
- Update to freeipmi-0.7.12
* Thu Aug 6 2009 Jan Safranek <jsafrane@redhat.com> - 0.7.11-2