xref: /dragonfly/etc/rc.d/named (revision 1847e88f)
1#!/bin/sh
2#
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.6 2005/11/19 21:47:32 swildner Exp $
6#
7
8# PROVIDE: named
9# REQUIRE: SERVERS
10# BEFORE:  DAEMON
11
12. /etc/rc.subr
13
14name="named"
15rcvar=`set_rcvar`
16command="/usr/sbin/${name}"
17start_precmd="named_precmd"
18required_dirs="$named_chrootdir"	# if it is set, it must exist
19extra_commands="reload"
20
21nuser=bind
22
23named_precmd()
24{
25	# Is the user using a sandbox?
26	if [ -z "$named_chrootdir" ]; then
27		rc_flags="-u $nuser $rc_flags"
28		return 0
29	fi
30
31	#       Change run_rc_commands()'s internal copy of $named_flags
32	#
33	rc_flags="-u $nuser -t ${named_chrootdir} $rc_flags"
34}
35
36load_rc_config $name
37# The following variable requires that rc.conf be loaded first
38#
39required_dirs="$named_chrootdir"	# if it is set, it must exist
40pidfile="${named_chrootdir}${named_pidfile:-/var/run/${name}.pid}"
41
42run_rc_command "$1"
43