named.init (817B)
1 #!/bin/sh /etc/rc.common 2 # Copyright (C) 2014 Noah Meyerhans <frodo@morgul.net> 3 # Licensed under the terms of the GNU General Public License version 2 4 # or (at your discretion) any later later version 5 6 USE_PROCD=1 7 8 START=50 9 10 config_file=/etc/bind/named.conf 11 pid_file=/var/run/named/named.pid 12 13 logdir=/var/log/named/ 14 cachedir=/var/cache/bind 15 libdir=/var/lib/bind 16 17 fix_perms() { 18 for dir in $libdir $logdir $cachedir; do 19 test -e "$dir" || { 20 mkdir -p "$dir" 21 chgrp bind "$dir" 22 chmod g+w "$dir" 23 } 24 done 25 } 26 27 start_service() { 28 user_exists bind 57 || user_add bind 57 29 group_exists bind 57 || group_add bind 57 30 fix_perms 31 procd_open_instance 32 procd_set_param command /usr/sbin/named -u bind -f -c $config_file 33 procd_set_param respawn 34 procd_close_instance 35 }