named (124616) | named (124622) |
---|---|
1#!/bin/sh 2# 3# $NetBSD: named,v 1.10 2002/03/22 04:33:59 thorpej Exp $ | 1#!/bin/sh 2# 3# $NetBSD: named,v 1.10 2002/03/22 04:33:59 thorpej Exp $ |
4# $FreeBSD: head/etc/rc.d/named 124616 2004-01-17 10:16:38Z mtm $ | 4# $FreeBSD: head/etc/rc.d/named 124622 2004-01-17 10:59:43Z mtm $ |
5# 6 7# PROVIDE: named 8# REQUIRE: SERVERS 9# BEFORE: DAEMON 10# KEYWORD: FreeBSD 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" | 5# 6 7# PROVIDE: named 8# REQUIRE: SERVERS 9# BEFORE: DAEMON 10# KEYWORD: FreeBSD 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" |
20nuser=bind 21ngroup=bind |
|
20 | 22 |
21case ${OSTYPE} in 22FreeBSD) 23 nuser=bind 24 ngroup=bind 25 ;; 26NetBSD) 27 nuser=named 28 ngroup=named 29 ;; 30esac 31 | |
32# If running in a chroot cage, ensure that the appropriate files 33# exist inside the cage, as well as helper symlinks into the cage 34# from outside. 35# 36# As this is called after the is_running and required_dir checks 37# are made in run_rc_command(), we can safely assume ${named_chrootdir} 38# exists and named isn't running at this point (unless forcestart 39# is used). --- 33 unchanged lines hidden (view full) --- 73{ 74 ln -fs "${named_chrootdir}${named_pidfile}" ${named_pidfile} 75 ln -fs "${named_chrootdir}/var/run/ndc" /var/run/ndc 76 77} 78 79named_precmd() 80{ | 23# If running in a chroot cage, ensure that the appropriate files 24# exist inside the cage, as well as helper symlinks into the cage 25# from outside. 26# 27# As this is called after the is_running and required_dir checks 28# are made in run_rc_command(), we can safely assume ${named_chrootdir} 29# exists and named isn't running at this point (unless forcestart 30# is used). --- 33 unchanged lines hidden (view full) --- 64{ 65 ln -fs "${named_chrootdir}${named_pidfile}" ${named_pidfile} 66 ln -fs "${named_chrootdir}/var/run/ndc" /var/run/ndc 67 68} 69 70named_precmd() 71{ |
81 case ${OSTYPE} in 82 FreeBSD) 83 ! checkyesno named_rcng && return 0 84 # Is the user using a sandbox? 85 if [ -z "$named_chrootdir" ]; then 86 rc_flags="-u $nuser -g $ngroup $rc_flags" 87 return 0 88 fi | 72 ! checkyesno named_rcng && return 0 73 # Is the user using a sandbox? 74 if [ -z "$named_chrootdir" ]; then 75 rc_flags="-u $nuser -g $ngroup $rc_flags" 76 return 0 77 fi |
89 | 78 |
90 # Do the following checks only if the user wants them done 91 checkyesno named_chroot_autoupdate && chroot_autoupdate 92 ;; 93 NetBSD) 94 chroot_autoupdate 95 ;; 96 esac | 79 # Do the following checks only if the user wants them done 80 checkyesno named_chroot_autoupdate && chroot_autoupdate |
97 | 81 |
98 case ${OSTYPE} in 99 FreeBSD) 100 # Make the symlinks only if the user wants them done. 101 checkyesno named_symlink_enable && make_symlinks 102 ;; 103 NetBSD) 104 make_symlinks 105 ;; 106 esac | 82 # Make the symlinks only if the user wants them done. 83 checkyesno named_symlink_enable && make_symlinks |
107 108 # Change run_rc_commands()'s internal copy of $named_flags 109 # | 84 85 # Change run_rc_commands()'s internal copy of $named_flags 86 # |
110 case ${OSTYPE} in 111 FreeBSD) 112 ! checkyesno named_rcng && return 113 ;; 114 esac | 87 ! checkyesno named_rcng && return |
115 rc_flags="-u $nuser -g $ngroup -t ${named_chrootdir} $rc_flags" 116} 117 118load_rc_config $name 119# The following variable requires that rc.conf be loaded first 120# 121required_dirs="$named_chrootdir" # if it is set, it must exist 122pidfile="${named_pidfile:-/var/run/${name}/pid}" 123 124run_rc_command "$1" | 88 rc_flags="-u $nuser -g $ngroup -t ${named_chrootdir} $rc_flags" 89} 90 91load_rc_config $name 92# The following variable requires that rc.conf be loaded first 93# 94required_dirs="$named_chrootdir" # if it is set, it must exist 95pidfile="${named_pidfile:-/var/run/${name}/pid}" 96 97run_rc_command "$1" |