diff options
Diffstat (limited to 'community/bind-geodns/bind.install')
-rw-r--r-- | community/bind-geodns/bind.install | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/community/bind-geodns/bind.install b/community/bind-geodns/bind.install new file mode 100644 index 000000000..39ae9f202 --- /dev/null +++ b/community/bind-geodns/bind.install @@ -0,0 +1,28 @@ +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 +} |