PREIN
/bin/sh
if [ -n "`/bin/id -u rpc 2>/dev/null`" ]; then
if [ "`/bin/id -u rpc`" != "22" ]; then
echo "Error: user rpc doesn't have uid=22. Correct this before installing portmap." 1>&2
exit 1
fi
else
echo "Adding user rpc UID=22."
/usr/sbin/useradd \
\
-u 22 \
-r \
-d /usr/share/empty \
-s /bin/false \
-c "Portmapper RPC User"\
-g nobody \
\
\
rpc 1>&2 || exit $?
[ ! -x /usr/sbin/nscd ] || /usr/sbin/nscd -i passwd || :
fi;
PREUN
/bin/sh
if [ "$1" = "0" ] ; then
{
if [ -f /var/lock/subsys/portmap ]; then
/sbin/service portmap stop 1>&2 || :;
fi }; /sbin/chkconfig --del portmap
fi
POSTIN
/bin/sh
/sbin/chkconfig --add portmap
{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/portmap ] && . /etc/sysconfig/portmap
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/portmap ]; then
/sbin/service portmap restart 1>&2 || :;
else
echo 'Run "/sbin/service portmap start" to start portmap daemon.'
fi
fi };
POSTUN
/bin/sh
if [ "$1" = "0" ]; then
/usr/lib/rpm/user_group.sh user del rpc
fi
Triggers
portmap <=
portmap-4.0-9
/bin/sh
/sbin/chkconfig --add portmap