PREIN
/bin/sh
getent group ods >/dev/null || groupadd -r ods
getent passwd ods >/dev/null || \
useradd -r -g ods -d /etc/opendnssec -s /sbin/nologin \
-c "opendnssec daemon account" ods
exit 0
PREUN
/bin/sh
if [ $1 -eq 0 ] ; then
# Package removal, not upgrade
/usr/bin/systemctl --no-reload disable ods-enforcerd.service > /dev/null 2>&1 || :
/usr/bin/systemctl stop ods-enforcerd.service > /dev/null 2>&1 || :
fi
if [ $1 -eq 0 ] ; then
# Package removal, not upgrade
/usr/bin/systemctl --no-reload disable ods-signerd.service > /dev/null 2>&1 || :
/usr/bin/systemctl stop ods-signerd.service > /dev/null 2>&1 || :
fi
POSTIN
/bin/sh
# in case we update any xml conf file
ods-ksmutil update all ||: >/dev/null 2>/dev/null
if [ $1 -eq 1 ] ; then
# Initial installation
/usr/bin/systemctl preset ods-enforcerd.service >/dev/null 2>&1 || :
fi
if [ $1 -eq 1 ] ; then
# Initial installation
/usr/bin/systemctl preset ods-signerd.service >/dev/null 2>&1 || :
fi
# Initialise a slot on the softhsm on first install
if [ "$1" -eq 1 ]; then
softhsm --init-token --slot 0 --label "OpenDNSSEC" --pin 1234 --so-pin 1234
fi
POSTUN
/bin/sh
/usr/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
/usr/bin/systemctl try-restart ods-enforcerd.service >/dev/null 2>&1 || :
fi
/usr/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
/usr/bin/systemctl try-restart ods-signerd.service >/dev/null 2>&1 || :
fi