post_install() { getent group named >/dev/null || usr/sbin/groupadd -g 40 named getent passwd named >/dev/null || usr/sbin/useradd -u 40 -c "BIND DNS Server" -g named -d /var/named -s /bin/false named usr/bin/passwd -l named &>/dev/null [ -f var/log/named.log ] || : >var/log/named.log chown named.named var/log/named.log # create an rndc.key if it doesn't already exist if [ ! -s etc/rndc.key ]; then usr/sbin/rndc-confgen -b 256 | head -n 5 >>etc/rndc.key chown root.named etc/rndc.key chmod 640 etc/rndc.key fi } post_upgrade() { post_install $1 # old versions of this package didn't have a named user chown -R named:named var/named # old versions of this package didn't set permissions correct chown root:named etc/named.conf chmod 640 etc/named.conf } pre_remove() { usr/sbin/userdel named &>/dev/null usr/sbin/groupdel named &>/dev/null }