packages: nagios-plugin-check_raid/nagios-plugin-check_raid.spec - version ...

glen glen at pld-linux.org
Wed Sep 9 19:17:33 CEST 2009


Author: glen                         Date: Wed Sep  9 17:17:33 2009 GMT
Module: packages                      Tag: HEAD
---- Log message:
- version 2.1 with my excessive changes

---- Files affected:
packages/nagios-plugin-check_raid:
   nagios-plugin-check_raid.spec (1.3 -> 1.4) 

---- Diffs:

================================================================
Index: packages/nagios-plugin-check_raid/nagios-plugin-check_raid.spec
diff -u packages/nagios-plugin-check_raid/nagios-plugin-check_raid.spec:1.3 packages/nagios-plugin-check_raid/nagios-plugin-check_raid.spec:1.4
--- packages/nagios-plugin-check_raid/nagios-plugin-check_raid.spec:1.3	Wed Sep  9 16:30:16 2009
+++ packages/nagios-plugin-check_raid/nagios-plugin-check_raid.spec	Wed Sep  9 19:17:28 2009
@@ -1,11 +1,9 @@
 # $Revision$, $Date$
-# TODO:
-# If you call 'check_raid -S' as root it will attempt to add the required lines to the sudoers file in order for itself to work.
 %define		plugin	check_raid
 Summary:	Nagios plugin to check current server's RAID status
 Name:		nagios-plugin-%{plugin}
-Version:	2.0
-Release:	0.2
+Version:	2.1
+Release:	0.5
 License:	Unknown
 Group:		Networking
 Source0:	%{plugin}
@@ -13,6 +11,7 @@
 URL:		http://exchange.nagios.org/directory/Plugins/Hardware/Storage-Systems/RAID-Controllers/check_raid/details
 Source1:	%{plugin}.cfg
 Requires:	nagios-core
+Requires:	sudo
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -40,6 +39,18 @@
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%post
+if [ "$1" = 1 ]; then
+	# setup sudo rules on first install
+	%{plugindir}/%{plugin} -S || :
+fi
+
+%postun
+if [ "$1" = 0 ]; then
+	# remove all sudo rules related to us
+	%{__sed} -i -e '/CHECK_RAID/d' /etc/sudoers
+fi
+
 %files
 %defattr(644,root,root,755)
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{plugin}.cfg
@@ -51,6 +62,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.4  2009/09/09 17:17:28  glen
+- version 2.1 with my excessive changes
+
 Revision 1.3  2009/09/09 14:30:16  glen
 - use exchange.nagios.org url
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/nagios-plugin-check_raid/nagios-plugin-check_raid.spec?r1=1.3&r2=1.4&f=u



More information about the pld-cvs-commit mailing list