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