PREIN
/bin/sh
if [ -n "`/usr/bin/getgid nscd`" ]; then
if [ "`/usr/bin/getgid nscd`" != "144" ]; then
echo "Error: group nscd doesn't have gid=144. Correct this before installing nscd." 1>&2
exit 1
fi
else
echo "Adding group nscd GID=144."
/usr/sbin/groupadd -g 144 -r nscd 1>&2 || exit $?
[ ! -x /usr/sbin/nscd ] || /usr/sbin/nscd -i group || :
fi;
if [ -n "`/bin/id -u nscd 2>/dev/null`" ]; then
if [ "`/bin/id -u nscd`" != "144" ]; then
echo "Error: user nscd doesn't have uid=144. Correct this before installing nscd." 1>&2
exit 1
fi
else
echo "Adding user nscd UID=144."
/usr/sbin/useradd \
\
-u 144 \
-r \
-d /tmp \
-s /bin/false \
-c "nscd"\
-g nscd \
\
\
nscd 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/nscd ]; then
/sbin/service nscd stop 1>&2 || :;
fi }; /sbin/chkconfig --del nscd
fi
POSTIN
/bin/sh
/sbin/chkconfig --add nscd
touch /var/log/nscd
chmod 000 /var/log/nscd
chown root:root /var/log/nscd
chmod 640 /var/log/nscd
{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/nscd ] && . /etc/sysconfig/nscd
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/nscd ]; then
/sbin/service nscd restart 1>&2 || :;
else
echo 'Run "/sbin/service nscd start" to start nscd daemon.'
fi
fi };
POSTUN
/bin/sh
if [ "$1" = "0" ]; then
/usr/lib/rpm/user_group.sh user del nscd
/usr/lib/rpm/user_group.sh group del nscd
fi