diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1998-07-07 22:05:16 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1998-07-07 22:05:16 +0000 |
commit | e015ec0aa2cf28b3a0cb1cc89f8ab5b1aec03cf6 (patch) | |
tree | 64cd1a80f2425b98548166c610b9dd6230c0cdcd | |
parent | 3a6ee8eaae240dc3b58c436411dc9dbc5d07f8f3 (diff) |
make 'ndc start' use the values of named_flags, named_user, and named_chroot from /etc/rc.conf; based on a patch from ibo@ragnarok.val-axs.net
-rw-r--r-- | usr.sbin/named/ndc/ndc.sh | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/usr.sbin/named/ndc/ndc.sh b/usr.sbin/named/ndc/ndc.sh index 4fcea9296a8..cdee868eb2a 100644 --- a/usr.sbin/named/ndc/ndc.sh +++ b/usr.sbin/named/ndc/ndc.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $OpenBSD: ndc.sh,v 1.10 1998/06/20 01:49:03 downsj Exp $ +# $OpenBSD: ndc.sh,v 1.11 1998/07/07 22:05:15 millert Exp $ USAGE='echo \ "usage: $0 \ @@ -9,18 +9,30 @@ USAGE='echo \ PATH=%DESTSBIN%:/bin:/usr/bin:/usr/ucb:$PATH +NAMED_CMD=named +RUNNING=0 if [ -r /etc/rc.conf ]; then CHROOTDIR=`. /etc/rc.conf ; echo "$named_chroot"` - # In case rc.conf exists but does not specify $named_chroot. - if [ "X${CHROOTDIR}" == "X" ]; then + if [ "X${CHROOTDIR}" != "X" ]; then + NAMED_CMD="${NAMED_CMD} -t ${CHROOTDIR}" + else + # Need a default CHROOTDIR=/var/named fi + + NAMED_USER=`. /etc/rc.conf ; echo "$named_user"` + if [ "X${NAMED_USER}" != "X" ]; then + NAMED_CMD="${NAMED_CMD} -u ${NAMED_USER}" + fi + + NAMED_FLAGS=`. /etc/rc.conf ; echo "$named_flags"` + if [ "X${NAMED_FLAGS}" != "X" ]; then + NAMED_CMD="${NAMED_CMD} ${NAMED_FLAGS}" + fi else CHROOTDIR=%CHROOTDIR% fi PIDFILE=${CHROOTDIR}/named.pid -NAMED_CMD=named -RUNNING=0 # # Pid file may live in chroot dir, check there first. |