PREIN
/bin/sh
getent group mongodb >/dev/null || groupadd -r mongodb getent passwd mongodb >/dev/null || \ useradd -r -g mongodb -d /var/lib/mongodb -s /sbin/nologin \ -c "MongoDB Database Server" mongodb exit 0
PREUN
/bin/sh
if [ $1 = 0 ] ; then /sbin/service stop >/dev/null 2>&1 /sbin/chkconfig --del mongod fi
POSTIN
/bin/sh
/sbin/chkconfig --add mongod
POSTUN
/bin/sh
if [ "$1" -ge "1" ] ; then /sbin/service mongod condrestart >/dev/null 2>&1 || : fi