packages/net/bind/files/named.init
Noah Meyerhans d3d3f1e57b bind: Use procd in /etc/init.d/named
Signed-off-by: Noah Meyerhans <frodo@morgul.net>
2014-12-06 14:11:10 -08:00

34 lines
760 B
Bash

#!/bin/sh /etc/rc.common
# Copyright (C) 2014 Noah Meyerhans <frodo@morgul.net>
# Licensed under the terms of the GNU General Public License version 2
# or (at your discretion) any later later version
USE_PROCD=1
START=50
config_file=/etc/bind/named.conf
pid_file=/var/run/named/named.pid
logdir=/var/log/named/
cachedir=/var/cache/bind
libdir=/var/lib/bind
config_file=/etc/bind/named.conf
fix_perms() {
for dir in $libdir $logdir $cachedir; do
test -e "$dir" || {
mkdir -p "$dir"
chgrp bind "$dir"
chmod g+w "$dir"
}
done
}
start_service() {
fix_perms
procd_open_instance
procd_set_param command /usr/sbin/named -u bind -f -c $config_file
procd_set_param respawn
procd_close_instance
}