Raise WARNS to 6 and fix resulting warnings.
[dragonfly.git] / etc / rc.d / named
blob1ae94e2b7210f39e5ec5708489cba91189fb0a12
1 #!/bin/sh
3 # $NetBSD: named,v 1.10 2002/03/22 04:33:59 thorpej Exp $
4 # $FreeBSD: src/etc/rc.d/named,v 1.6 2003/01/12 04:53:54 mtm Exp $
5 # $DragonFly: src/etc/rc.d/named,v 1.8 2006/09/20 21:48:38 victor Exp $
8 # PROVIDE: named
9 # REQUIRE: SERVERS
10 # BEFORE: DAEMON
12 . /etc/rc.subr
14 name="named"
15 rcvar=`set_rcvar`
16 command="/usr/sbin/${name}"
17 start_precmd="named_precmd"
18 required_dirs="$named_chrootdir" # if it is set, it must exist
19 extra_commands="reload"
21 nuser=bind
23 named_precmd()
25 # Is the user using a sandbox?
26 if [ -z "$named_chrootdir" ]; then
27 rc_flags="-u $nuser $rc_flags"
28 return 0
30 # If it is using a sandbox and the user haven't changed the default
31 # named_flags, change the named.conf path to stop bind shouting a
32 # warning about config file path being part of the sandbox path
33 elif [ ! -n "$named_flags" ]; then
34 rc_flags="-c named.conf"
37 # Change run_rc_commands()'s internal copy of $named_flags
39 rc_flags="-u $nuser -t ${named_chrootdir} $rc_flags"
40 cp /etc/localtime ${named_chrootdir}/etc
43 load_rc_config $name
44 # The following variable requires that rc.conf be loaded first
46 required_dirs="$named_chrootdir" # if it is set, it must exist
47 pidfile="${named_chrootdir}${named_pidfile:-/var/run/${name}.pid}"
49 run_rc_command "$1"