[packages/nagios-plugin-check_raid] own sudoes config file (as ghost)

glen glen at pld-linux.org
Wed Mar 2 08:10:55 CET 2016


commit bd50b177f11986ce76c9aa11511ca71d45f29344
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Wed Mar 2 09:10:32 2016 +0200

    own sudoes config file (as ghost)
    
    this will cleanup the file once package is removed

 nagios-plugin-check_raid.spec | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/nagios-plugin-check_raid.spec b/nagios-plugin-check_raid.spec
index 5d9c45c..e968a06 100644
--- a/nagios-plugin-check_raid.spec
+++ b/nagios-plugin-check_raid.spec
@@ -87,14 +87,15 @@ test "$(echo "$ver" | awk '{print $NF}')" = %{version}
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{nrpeddir},%{plugindir}}
+install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{nrpeddir},%{plugindir},/etc/sudoers.d}
 %{__make} install \
 	DESTDIR=$RPM_BUILD_ROOT
 
 cp -p %{plugin}.cfg $RPM_BUILD_ROOT%{_sysconfdir}
 touch $RPM_BUILD_ROOT%{nrpeddir}/%{plugin}.cfg
+touch $RPM_BUILD_ROOT/etc/sudoers.d/check_raid
 
-# no .ext
+# remove .pl extension
 mv $RPM_BUILD_ROOT%{plugindir}/%{plugin}{.pl,}
 
 # cleanup
@@ -111,7 +112,6 @@ rm -rf $RPM_BUILD_ROOT
 grep -q '^#includedir /etc/sudoers\.d' /etc/sudoers && confd=1
 
 if [ "$1" = 1 -o "$confd" = 1 ]; then
-	# setup sudo rules on first install
 	%{plugindir}/%{plugin} -S || :
 fi
 
@@ -123,7 +123,6 @@ fi
 
 %triggerpostun -- %{name} < 3.1.1-0.2, sudo < 1:1.8.7-2
 if grep -q '^#includedir /etc/sudoers\.d' /etc/sudoers; then
-	# setup sudo rules on first install
 	%{plugindir}/%{plugin} -S || :
 fi
 # remove CHECK_RAID rules from /etc/sudoers if separate config is in place
@@ -142,6 +141,7 @@ fi
 %attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{plugin}.cfg
 %attr(755,root,root) %{plugindir}/%{plugin}
 %ghost %{nrpeddir}/%{plugin}.cfg
+%ghost /etc/sudoers.d/check_raid
 %dir %{perl_vendorlib}/App/Monitoring
 %dir %{perl_vendorlib}/App/Monitoring/Plugin
 %{perl_vendorlib}/App/Monitoring/Plugin/CheckRaid.pm
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/nagios-plugin-check_raid.git/commitdiff/bd50b177f11986ce76c9aa11511ca71d45f29344



More information about the pld-cvs-commit mailing list