PREUN
/bin/sh
if [ $1 = 0 ] ; then
/bin/systemctl --no-reload disable pki-ocspd.target > /dev/null 2>&1 || :
/bin/systemctl stop pki-ocspd.target > /dev/null 2>&1 || :
fi
POSTIN
/bin/sh
# Attempt to update ALL old "OCSP" instances to "systemd"
if [ -d /etc/sysconfig/pki/ocsp ]; then
for inst in `ls /etc/sysconfig/pki/ocsp`; do
if [ ! -e "/etc/systemd/system/pki-ocspd.target.wants/pki-ocspd@${inst}.service" ]; then
ln -s "/lib/systemd/system/pki-ocspd@.service" \
"/etc/systemd/system/pki-ocspd.target.wants/pki-ocspd@${inst}.service"
[ -L /var/lib/${inst}/${inst} ] && unlink /var/lib/${inst}/${inst}
ln -s /usr/sbin/tomcat6-sysd /var/lib/${inst}/${inst}
if [ -e /var/run/${inst}.pid ]; then
kill -9 `cat /var/run/${inst}.pid` || :
rm -f /var/run/${inst}.pid
echo "pkicreate.systemd.servicename=pki-ocspd@${inst}.service" >> \
/var/lib/${inst}/conf/CS.cfg || :
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
/bin/systemctl restart pki-ocspd@${inst}.service || :
else
echo "pkicreate.systemd.servicename=pki-ocspd@${inst}.service" >> \
/var/lib/${inst}/conf/CS.cfg || :
fi
else
# Conditionally restart this Dogtag 9 instance
/bin/systemctl condrestart pki-ocspd@${inst}.service
fi
done
fi
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
(
if [ -d /etc/sysconfig/pki/%i ]; then
for F in `find /etc/sysconfig/pki/ocsp -type f`; do
instance=`basename $F`
if [ -f /etc/sysconfig/$instance ]; then
sed -i -e 's/catalina.out/tomcat-initd.log/' /etc/sysconfig/$instance
fi
done
fi
)
POSTUN
/bin/sh
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ "$1" -ge "1" ] ; then
/bin/systemctl try-restart pki-ocspd.target >/dev/null 2>&1 || :
fi