PREUN
/bin/sh
if [ "$1" = 0 ] ; then
/etc/init.d/funcd stop > /dev/null 2>&1
if [ -x /bin/systemctl ]; then
# Package removal, not upgrade
/bin/systemctl --no-reload disable funcd.service > /dev/null 2>&1 || :
/bin/systemctl stop funcd.service > /dev/null 2>&1 || :
elif [ -x /usr/lib/lsb/remove_initd ]; then
/usr/lib/lsb/remove_initd /etc/init.d/funcd
elif [ -x /sbin/chkconfig ]; then
/sbin/chkconfig --del funcd
else
rm -f /etc/rc.d/rc?.d/???funcd
fi
fi
POSTIN
/bin/sh
# systemd
if [ -x /bin/systemctl ]; then
if [ $1 -eq 1 ] ; then
# Initial installation
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
fi
fi
# for suse
if [ -x /usr/lib/lsb/install_initd ]; then
/usr/lib/lsb/install_initd /etc/init.d/funcd
# for red hat distros
elif [ -x /sbin/chkconfig ]; then
/sbin/chkconfig --add funcd
# or, the old fashioned way
else
for i in 2 3 4 5; do
ln -sf /etc/init.d/funcd /etc/rc.d/rc${i}.d/S99funcd
done
for i in 1 6; do
ln -sf /etc/init.d/funcd /etc/rc.d/rc${i}.d/k01funcd
done
fi
# fix perms on log files
chmod 600 /var/log/func/func.log
chmod 600 /var/log/func/audit.log
# upgrade old installs if needed
#/usr/bin/update-func
exit 0
POSTUN
/bin/sh
if [ -x /bin/systemctl ]; then
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
/bin/systemctl try-restart funcd.service >/dev/null 2>&1 || :
fi
fi
Triggers
func <
0.28-2
/bin/sh
# Save the current service runlevel info
# User must manually run systemd-sysv-convert --apply funcd
# to migrate them to systemd targets
/usr/bin/systemd-sysv-convert --save funcd >/dev/null 2>&1 ||:
# Run these because the SysV package being removed won't do them
/sbin/chkconfig --del funcd >/dev/null 2>&1 || :
/bin/systemctl try-restart funcd.service >/dev/null 2>&1 || :