From d813d4a3c774e213e7926da58529b462fdbead42 Mon Sep 17 00:00:00 2001 From: Todd Zullinger Date: Thu, 2 Oct 2008 08:10:05 -0400 Subject: Create puppet user/group according to Fedora packaging guidelines --- puppet.spec | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/puppet.spec b/puppet.spec index a3529f3..6b196f7 100644 --- a/puppet.spec +++ b/puppet.spec @@ -23,6 +23,7 @@ Requires: ruby-shadow Requires: facter >= 1.1.4 Requires: ruby >= 1.8.1 +Requires(pre): shadow-utils Requires(post): chkconfig Requires(preun): chkconfig Requires(preun): initscripts @@ -147,11 +148,13 @@ touch %{buildroot}%{_sysconfdir}/puppet/puppetd.conf %doc %{_mandir}/man8/puppetrun.8.gz %pre -/usr/sbin/groupadd -r puppet 2>/dev/null || : -/usr/sbin/useradd -g puppet -c "Puppet" \ - -s /sbin/nologin -r -d /var/lib/puppet puppet 2> /dev/null || : +getent group puppet >/dev/null || groupadd -r puppet +getent passwd puppet >/dev/null || \ +useradd -r -g puppet -d %{_localstatedir}/lib/puppet -s /sbin/nologin \ + -c "Puppet" puppet || : +# ensure that old setups have the right puppet home dir if [ $1 -gt 1 ] ; then - /usr/sbin/usermod -d /var/lib/puppet puppet || : + usermod -d %{_localstatedir}/lib/puppet puppet || : fi %post @@ -192,6 +195,7 @@ rm -rf %{buildroot} - Require chkconfig and initstripts for preun, post, and postun scripts - Conditionally restart puppet in %%postun - Ensure %%preun, %%post, and %%postun scripts exit cleanly +- Create puppet user/group according to Fedora packaging guidelines - Quiet a few rpmlint complaints - Remove useless %%pbuild macro - Make specfile more like the Fedora/EPEL template -- cgit