summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTodd Zullinger <tmz@pobox.com>2008-10-02 08:00:21 -0400
committerTodd Zullinger <tmz@pobox.com>2008-10-02 08:00:21 -0400
commit657b9c6f8795bae609ab6120bb5cfb6ddea9e328 (patch)
treec7df213592d5aeee00979ecb8bb179ec531dd490
parente53381046b3de666a86bd2dca0bd75c319bd3293 (diff)
downloadpuppet-package.git~-657b9c6f8795bae609ab6120bb5cfb6ddea9e328.tar.gz
puppet-package.git~-657b9c6f8795bae609ab6120bb5cfb6ddea9e328.tar.xz
puppet-package.git~-657b9c6f8795bae609ab6120bb5cfb6ddea9e328.zip
Clean up %preun, %post, and %postun scriptlets
- Require chkconfig and initstripts for preun, post, and postun scripts - Conditionally restart puppet in %%postun - Ensure %%preun, %%post, and %%postun scripts exit cleanly
-rw-r--r--puppet.spec28
1 files changed, 22 insertions, 6 deletions
diff --git a/puppet.spec b/puppet.spec
index f36530e..a3529f3 100644
--- a/puppet.spec
+++ b/puppet.spec
@@ -23,6 +23,10 @@ Requires: ruby-shadow
Requires: facter >= 1.1.4
Requires: ruby >= 1.8.1
+Requires(post): chkconfig
+Requires(preun): chkconfig
+Requires(preun): initscripts
+Requires(postun): initscripts
%description
Puppet lets you centrally manage every important aspect of your system using a
@@ -34,6 +38,10 @@ along with obviously discrete elements like packages, services, and files.
Group: System Environment/Base
Summary: Server for the puppet system management tool
Requires: puppet = %{version}-%{release}
+Requires(post): chkconfig
+Requires(preun): chkconfig
+Requires(preun): initscripts
+Requires(postun): initscripts
%description server
Provides the central puppet server daemon which provides manifests to clients.
@@ -145,28 +153,33 @@ touch %{buildroot}%{_sysconfdir}/puppet/puppetd.conf
if [ $1 -gt 1 ] ; then
/usr/sbin/usermod -d /var/lib/puppet puppet || :
fi
+
%post
-/sbin/chkconfig --add puppet
-exit 0
+/sbin/chkconfig --add puppet || :
%post server
-/sbin/chkconfig --add puppetmaster
+/sbin/chkconfig --add puppetmaster || :
%preun
if [ "$1" = 0 ] ; then
/sbin/service puppet stop > /dev/null 2>&1
- /sbin/chkconfig --del puppet
+ /sbin/chkconfig --del puppet || :
fi
%preun server
if [ "$1" = 0 ] ; then
/sbin/service puppetmaster stop > /dev/null 2>&1
- /sbin/chkconfig --del puppetmaster
+ /sbin/chkconfig --del puppetmaster || :
+fi
+
+%postun
+if [ "$1" -ge 1 ]; then
+ /sbin/service puppet condrestart >/dev/null 2>&1 || :
fi
%postun server
if [ "$1" -ge 1 ]; then
- /sbin/service puppetmaster condrestart > /dev/null 2>&1
+ /sbin/service puppetmaster condrestart > /dev/null 2>&1 || :
fi
%clean
@@ -176,6 +189,9 @@ rm -rf %{buildroot}
* Wed Oct 01 2008 Todd Zullinger <tmz@pobox.com> - 0.24.5-2
- Require ruby-shadow on Fedora and RHEL >= 5
- Simplify Fedora/RHEL version checks for ruby(abi) and BuildArch
+- Require chkconfig and initstripts for preun, post, and postun scripts
+- Conditionally restart puppet in %%postun
+- Ensure %%preun, %%post, and %%postun scripts exit cleanly
- Quiet a few rpmlint complaints
- Remove useless %%pbuild macro
- Make specfile more like the Fedora/EPEL template