Wed, 08 Feb 2012 20:07:00 +0200
Update version, adapt patch, correct PID writing, correct build on newer
FreeBSD releases, and most importantly introduce new patch to try to
avoid segfault caused by multiple network interfaces with the same (or
no) address. This is common when configuring bridges and tunnels.
michael@556 | 1 | #!@l_prefix@/bin/openpkg rc |
michael@556 | 2 | ## |
michael@556 | 3 | ## rc.bind -- Run-Commands |
michael@556 | 4 | ## |
michael@556 | 5 | |
michael@556 | 6 | %config |
michael@556 | 7 | bind_enable="$openpkg_rc_def" |
michael@556 | 8 | bind_flags="" |
michael@556 | 9 | bind_log_prolog="true" |
michael@556 | 10 | bind_log_epilog="true" |
michael@556 | 11 | bind_log_numfiles="10" |
michael@556 | 12 | bind_log_minsize="1M" |
michael@556 | 13 | bind_log_complevel="9" |
michael@556 | 14 | bind_stats_prolog="true" |
michael@556 | 15 | bind_stats_epilog="true" |
michael@556 | 16 | bind_stats_numfiles="10" |
michael@556 | 17 | bind_stats_minsize="1M" |
michael@556 | 18 | bind_stats_complevel="9" |
michael@556 | 19 | |
michael@556 | 20 | %status -u @l_susr@ -o |
michael@556 | 21 | bind_usable="no" |
michael@556 | 22 | bind_active="no" |
michael@556 | 23 | @l_prefix@/sbin/named-checkconf >/dev/null && bind_usable="yes" |
michael@556 | 24 | @l_prefix@/sbin/rndc status >/dev/null 2>&1 && bind_active="yes" |
michael@556 | 25 | echo "bind_enable=\"$bind_enable\"" |
michael@556 | 26 | echo "bind_usable=\"$bind_usable\"" |
michael@556 | 27 | echo "bind_active=\"$bind_active\"" |
michael@556 | 28 | |
michael@556 | 29 | %start -p 100 -u @l_susr@ |
michael@556 | 30 | rcService bind enable yes || exit 0 |
michael@556 | 31 | rcService bind active yes && exit 0 |
michael@556 | 32 | @l_prefix@/sbin/named -u @l_rusr@ ${bind_flags} |
michael@556 | 33 | |
michael@556 | 34 | %stop -p 900 -u @l_susr@ |
michael@556 | 35 | rcService bind enable yes || exit 0 |
michael@556 | 36 | rcService bind active no && exit 0 |
michael@556 | 37 | @l_prefix@/sbin/rndc stop |
michael@556 | 38 | sleep 2 |
michael@556 | 39 | |
michael@556 | 40 | %restart -p 100 -u @l_susr@ |
michael@556 | 41 | rcService bind enable yes || exit 0 |
michael@556 | 42 | rcService bind active no && exit 0 |
michael@556 | 43 | rc bind stop start |
michael@556 | 44 | |
michael@556 | 45 | %reload -p 100 -u @l_susr@ |
michael@556 | 46 | rcService bind enable yes || exit 0 |
michael@556 | 47 | rcService bind active no && exit 0 |
michael@556 | 48 | @l_prefix@/sbin/rndc reload |
michael@556 | 49 | |
michael@556 | 50 | %daily -u @l_susr@ |
michael@556 | 51 | rcService bind enable yes || exit 0 |
michael@556 | 52 | shtool rotate -f \ |
michael@556 | 53 | -n $bind_stats_numfiles -s $bind_stats_minsize -d \ |
michael@556 | 54 | -z $bind_stats_complevel -m 644 -o @l_rusr@ -g @l_rgrp@ \ |
michael@556 | 55 | -P "$bind_stats_prolog" \ |
michael@556 | 56 | -E "$bind_stats_epilog" \ |
michael@556 | 57 | @l_prefix@/var/bind/named.stats |
michael@556 | 58 | shtool rotate -f \ |
michael@556 | 59 | -n $bind_log_numfiles -s $bind_log_minsize -d \ |
michael@556 | 60 | -z $bind_log_complevel -m 644 -o @l_rusr@ -g @l_rgrp@ \ |
michael@556 | 61 | -P "$bind_log_prolog" \ |
michael@556 | 62 | -E "$bind_log_epilog; rc bind reload" \ |
michael@556 | 63 | @l_prefix@/var/bind/named.log |
michael@556 | 64 |