pkgsrc/net/bind9/files/named9.sh

52 lines
1.2 KiB
Bash
Raw Normal View History

#!@RCD_SCRIPTS_SHELL@
2002-09-23 16:40:51 +02:00
#
# $NetBSD: named9.sh,v 1.3 2005/05/17 13:17:34 sketch Exp $
2002-09-23 16:40:51 +02:00
#
2001-01-26 05:25:36 +01:00
# PROVIDE: named
# REQUIRE: SERVERS
# BEFORE: DAEMON
# KEYWORD: chrootdir
2001-01-26 05:25:36 +01:00
. /etc/rc.subr
name="named"
rcvar="${name}9"
2001-01-26 05:25:36 +01:00
command="@PREFIX@/sbin/${name}"
pidfile="/var/run/${name}.pid"
start_precmd="named_precmd"
2001-01-26 05:25:36 +01:00
extra_commands="reload"
required_dirs="$named_chrootdir" # if it is set, it must exist
2001-01-26 05:25:36 +01:00
named_precmd()
{
# Die if $named is also set (i.e. the system's named is not disabled
if checkyesno named ; then
warn \
"disable 'named' when setting 'named9'!"
return 1
fi
if [ -z "$named_chrootdir" ]; then
return 0;
fi
if [ ! -c "${named_chrootdir}/dev/null" ]; then
@RM@ -f "${named_chrootdir}/dev/null"
( cd /dev ; @PAX@ -rw -pe null "${named_chrootdir}/dev" )
fi
if [ -f /etc/localtime ]; then
@CMP@ -s /etc/localtime "${named_chrootdir}/etc/localtime" || \
@CP@ -p /etc/localtime "${named_chrootdir}/etc/localtime"
fi
@RM@ -f ${pidfile}
@LN@ -s "${named_chrootdir}${pidfile}" ${pidfile}
# Change run_rc_commands()'s internal copy of $named_flags
#
rc_flags="-u @BIND_USER@ -t ${named_chrootdir} $rc_flags"
2001-01-26 05:25:36 +01:00
}
load_rc_config "$rcvar"
2001-01-26 05:25:36 +01:00
run_rc_command "$1"