PREUN
/bin/sh
if [ $1 -eq 0 ] ; then
# Package removal, not upgrade
systemctl --no-reload disable named-chroot.service > /dev/null 2>&1 || :
systemctl stop named-chroot.service > /dev/null 2>&1 || :
fi
if [ $1 -eq 0 ] ; then
# Package removal, not upgrade
systemctl --no-reload disable named-sdb-chroot.service > /dev/null 2>&1 || :
systemctl stop named-sdb-chroot.service > /dev/null 2>&1 || :
fi
if [ "$1" -eq 0 ]; then
# Package removal, not upgrade
rm -f /var/named/chroot/dev/{random,zero,null}
rm -f /var/named/chroot/etc/localtime
fi
:;
POSTIN
/bin/sh
if [ $1 -eq 1 ] ; then
# Initial installation
systemctl preset named-chroot.service >/dev/null 2>&1 || :
fi
if [ $1 -eq 1 ] ; then
# Initial installation
systemctl preset named-sdb-chroot.service >/dev/null 2>&1 || :
fi
if [ "$1" -gt 0 ]; then
[ -e /var/named/chroot/dev/random ] || \
/bin/mknod /var/named/chroot/dev/random c 1 8
[ -e /var/named/chroot/dev/zero ] || \
/bin/mknod /var/named/chroot/dev/zero c 1 5
[ -e /var/named/chroot/dev/null ] || \
/bin/mknod /var/named/chroot/dev/null c 1 3
rm -f /var/named/chroot/etc/localtime
cp /etc/localtime /var/named/chroot/etc/localtime
fi;
:;
POSTUN
/bin/sh
# Package upgrade, not uninstall
systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
systemctl try-restart named-chroot.service >/dev/null 2>&1 || :
fi
systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
systemctl try-restart named-sdb-chroot.service >/dev/null 2>&1 || :
fi
POSTTRANS
/bin/sh
if [ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled; then
[ -x /sbin/restorecon ] && /sbin/restorecon /var/named/chroot/dev/* > /dev/null 2>&1;
fi;
:;