PREIN
/bin/sh
if [ "$1" = "1" ]; then
/usr/sbin/groupadd -r -f mlocate
fi
PREUN
/bin/sh
if [ $1 -eq 0 ] ; then
# Package removal, not upgrade
systemctl --no-reload disable --now mlocate-updatedb.timer >/dev/null 2>&1 || :
fi
POSTIN
/bin/sh
/usr/share/rpm-helper/create-file mlocate $1 /var/lib/mlocate/mlocate.db root mlocate 0640
if [ $1 -eq 1 ] ; then
# Initial installation
systemctl --no-reload preset mlocate-updatedb.timer >/dev/null 2>&1 || :
fi
systemctl start mlocate-updatedb.timer
systemctl start mlocate-updatedb.service
POSTUN
/bin/sh
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
systemctl try-restart mlocate-updatedb.timer >/dev/null 2>&1 || :
fi