PREIN
/bin/sh
getent group lfcmgr > /dev/null || groupadd -r lfcmgr
getent passwd lfcmgr > /dev/null || useradd -r -g lfcmgr \
-d /var/lib/lfc -s /bin/bash -c "LFC Manager" lfcmgr
exit 0
PREUN
/bin/sh
export LANG=C
if [ $1 = 0 ]; then
/usr/sbin/update-alternatives --display lfcdaemon | \
grep currently | grep -q lfc-mysql && \
/sbin/service lfc-mysql stop > /dev/null 2>&1 || :
/usr/sbin/update-alternatives --remove lfcdaemon \
/usr/lib/lfc-mysql/lfcdaemon
/sbin/chkconfig --del lfc-mysql
fi
POSTIN
/bin/sh
if [ $1 = 1 ]; then
/sbin/chkconfig --add lfc-mysql
fi
/usr/sbin/update-alternatives --install /usr/sbin/lfcdaemon lfcdaemon \
/usr/lib/lfc-mysql/lfcdaemon 20 \
--slave /usr/share/man/man8/lfcdaemon.8.gz lfcdaemon.8.gz \
/usr/lib/lfc-mysql/lfcdaemon.8.gz \
--slave /usr/share/lfc/NSCONFIG.templ NSCONFIG.templ \
/usr/lib/lfc-mysql/NSCONFIG.templ \
--slave /etc/sysconfig/lfcdaemon lfcdaemon.conf \
/etc/lfc-mysql/lfcdaemon.conf \
--slave /etc/logrotate.d/lfcdaemon lfcdaemon.logrotate \
/etc/lfc-mysql/lfcdaemon.logrotate \
--slave /usr/sbin/lfc-shutdown lfc-shutdown \
/usr/lib/lfc-mysql/lfc-shutdown \
--slave /usr/share/man/man8/lfc-shutdown.8.gz lfc-shutdown.8.gz \
/usr/lib/lfc-mysql/lfc-shutdown.8.gz \
--initscript lfc-mysql
POSTUN
/bin/sh
if [ $1 -ge 1 ]; then
/usr/sbin/update-alternatives --display lfcdaemon | \
grep currently | grep -q lfc-mysql && \
/sbin/service lfc-mysql condrestart > /dev/null 2>&1 || :
fi