1
0
forked from rpms/rpcbind

fix scriptlets to enable service by default

This commit is contained in:
Tom "spot" Callaway 2011-09-09 12:48:04 -04:00
parent eb69b46b83
commit 4b3219f049

View File

@ -1,6 +1,6 @@
Name: rpcbind
Version: 0.2.0
Release: 13%{?dist}
Release: 14%{?dist}
Summary: Universal Addresses to RPC Program Number Mapper
Group: System Environment/Daemons
License: BSD
@ -89,21 +89,22 @@ if [ -z "$rpcid" -o "$rpcid" != "32" ]; then
/usr/sbin/useradd -o -l -c "Rpcbind Daemon" -d /var/lib/rpcbind -g 32 \
-M -s /sbin/nologin -u 32 rpc > /dev/null 2>&1
fi
%post
if [ $1 -eq 1 ]; then
# Package install, not upgrade
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
%post
if [ $1 -eq 1 ] ; then
# Initial installation
/bin/systemctl enable rpcbind.service >/dev/null 2>&1 || :
fi
%preun
if [ $1 -eq 0 ]; then
# Package removal, not upgrade
/bin/systemctl --no-reload rpcbind.service >/dev/null 2>&1 || :
/bin/systemctl --no-reload disable rpcbind.service >/dev/null 2>&1 || :
/bin/systemctl stop rpcbind.service >/dev/null 2>&1 || :
/usr/sbin/userdel rpc 2>/dev/null || :
/usr/sbin/groupdel rpc 2>/dev/null || :
rm -rf /var/lib/rpcbind
fi
%postun
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ]; then
@ -113,7 +114,7 @@ fi
%triggerun -- rpcbind < 0.2.0-12
%{_bindir}/systemd-sysv-convert --save rpcbind >/dev/null 2>&1 ||:
/bin/systemctl enable rpcbind.service >/dev/null 2>&1
/bin/systemctl --no-reload enable rpcbind.service >/dev/null 2>&1
/sbin/chkconfig --del rpcbind >/dev/null 2>&1 || :
/bin/systemctl try-restart rpcbind.service >/dev/null 2>&1 || :
@ -129,6 +130,9 @@ fi
%dir %attr(700,rpc,rpc) /var/lib/rpcbind
%changelog
* Fri Sep 9 2011 Tom Callaway <spot@fedoraproject.org> - 0.2.0-14
- fix scriptlets to enable service by default
* Fri Jul 8 2011 Steve Dickson <steved@redhat.com> - 0.2.0-13
- Spec file clean up