#!/bin/sh # # $NetBSD: named,v 1.10 2002/03/22 04:33:59 thorpej Exp $ # $FreeBSD: src/etc/rc.d/named,v 1.6 2003/01/12 04:53:54 mtm Exp $ # $DragonFly: src/etc/rc.d/named,v 1.8 2006/09/20 21:48:38 victor Exp $ # # PROVIDE: named # REQUIRE: SERVERS # BEFORE: DAEMON . /etc/rc.subr name="named" rcvar=`set_rcvar` command="/usr/sbin/${name}" start_precmd="named_precmd" required_dirs="$named_chrootdir" # if it is set, it must exist extra_commands="reload" nuser=bind named_precmd() { # Is the user using a sandbox? if [ -z "$named_chrootdir" ]; then rc_flags="-u $nuser $rc_flags" return 0 # If it is using a sandbox and the user haven't changed the default # named_flags, change the named.conf path to stop bind shouting a # warning about config file path being part of the sandbox path elif [ ! -n "$named_flags" ]; then rc_flags="-c named.conf" fi # Change run_rc_commands()'s internal copy of $named_flags # rc_flags="-u $nuser -t ${named_chrootdir} $rc_flags" cp /etc/localtime ${named_chrootdir}/etc } load_rc_config $name # The following variable requires that rc.conf be loaded first # required_dirs="$named_chrootdir" # if it is set, it must exist pidfile="${named_chrootdir}${named_pidfile:-/var/run/${name}.pid}" run_rc_command "$1"