> естественно, а то как поднять VPN соединение к узлу записанному буковками.- а пингануть и потом букофки на циферки поменять не судьба?
- ну на тебе мое стряпанье. я бинд из сырцов всегда собирал и стартовые скрипты обычно сам пишу. в начале только переменные поправь. у меня он стоит в /chroot/bind и все соотвествующие пути заданы от него. FedoraCore-4.
[root@local ~]# cat /usr/local/etc/std/init.d/named
#!/bin/bash
###
### LS - FC 9.0
###
### this script will control DNS server.
### use 'chkconfig --add named' command to activate
### this script.
##
#
# chkconfig: 345 45 45
# description: DNS-server control
#
###
### 12.10.2008
###
selfname="named" # this script name
daemname="named" # bind daemon name
testname="named-checkconf" # checking tool name
ctrlname="rndc" # control tool name
confname="named.conf" # configuration file name
syscname="named" # system config file name
netcname="network" # network config name
funcname="functions" # functions name
lockname="${selfname}" # lock name
daempath="/usr/local/sbin/bind" # daemon directory
testpath="${daempath}" # checking tool path
ctrlpath="${daempath}" # control tool path
confpath="/etc" # configuration directory
syscpath="/etc/sysconfig" # system config directory
netcpath="${syscpath}" # network config path
funcpath="/etc/rc.d/init.d" # functions path
lockpath="/var/lock/subsys" # lock path
daemfile="${daempath}/${daemname}" # daemon binary file
testfile="${testpath}/${testname}" # checking tool file
ctrlfile="${ctrlpath}/${ctrlname}" # control tool file
conffile="${confpath}/${confname}" # configuration file
syscfile="${syscpath}/${syscname}" # system config file
netcfile="${netcpath}/${netcname}" # network config file
funcfile="${funcpath}/${funcname}" # functions file
lockfile="${lockpath}/${lockname}" # lock file
jailargs="" # chroot directory option
userargs="" # bind user option
optnargs="" # another bind options
[ -f ${funcfile} ] && source ${funcfile} || exit 2
function error()
{
if [ -n "${1}" ]
then
echo -n "${selfname}: ${1}"
failure "${1}"
echo
exit 1
fi
}
# initialization
initinfo=""
[ -f ${syscfile} ] && source ${syscfile}
[ -f ${netcfile} ] && source ${netcfile}
[ "${NETWORKING}" = "no" ] && exit 0
userargs="${BINDUSER}"
optnargs="${OPTIONS}"
[ -n "${ROOTDIR}" -a "x${ROOTDIR}" != "x/" ] && jailargs="${ROOTDIR}"
[ -f ${jailargs}${conffile} ] || error "can't find ${jailargs}${conffile}"
[ -f ${daemfile} ] || error "can't find ${daemfile}"
function start()
{
daeminfo="Starting DNS service:"
echo -n "${daeminfo}"
daempids=`/sbin/pidof -o ${$} -o ${PPID} -o %PPID ${daemfile} || \
/sbin/pidof -o ${$} -o ${PPID} -o %PPID ${daemname}`
if [ -n "${daempids}" ]
then
echo -n " already started:"
passed "${daeminfo} already started:"
echo
return 0
fi
[ -n "${jailargs}" ] && optnargs="${optnargs} -t ${jailargs}"
[ -n "${userargs}" ] && optnargs="${optnargs} -u ${userargs}"
${daemfile} ${optnargs}
daemcode=${?}
if [ ${daemcode} -eq 0 ]
then
success ${daeminfo}
echo
touch ${lockfile}
[ -n "${jailargs}" ] && \
[ -h "/var/run/named.pid" ] ||
ln -s ${jailargs}/var/run/named.pid /var/run/named.pid
else
failure ${daeminfo}
echo
fi
return ${daemcode}
}
function stop()
{
daeminfo="Stopping DNS service:"
echo -n "${daeminfo}"
daempids=`/sbin/pidof -o ${$} -o ${PPID} -o %PPID ${daemfile} || \
/sbin/pidof -o ${$} -o ${PPID} -o %PPID ${daemname}`
if [ -z "$daempids" ]
then
echo -n " already stopped:"
passed "${daeminfo} already stopped:"
echo
return 0
fi
${ctrlfile} stop 2>&1 >/dev/null
daemcode=${?}
if [ ${daemcode} -eq 0 ]
then
for waittime in 30000 50000 700000 1000000
do
usleep ${waitime}
daempids=`/sbin/pidof -o ${$} -o ${PPID} -o %PPID ${daemfile} || \
/sbin/pidof -o ${$} -o ${PPID} -o %PPID ${daemname}`
if [ -z "${daempids}" ]
then
success ${daeminfo}
echo
/bin/rm -f ${lockfile}
[ -h "/var/run/named.pid" ] && /bin/rm -f "/var/run/named.pid"
return 0
fi
done
fi
failure ${daeminfo}
echo
daeminfo="Killing ${daemname}:"
echo -n "${daeminfo}"
for killsign in "TERM" "KILL"
do
for waittime in 0 30000 50000 1000000
do
usleep ${waittime}
daempids=`/sbin/pidof -o ${$} -o ${PPID} -o %PPID ${daemfile} || \
/sbin/pidof -o ${$} -o ${PPID} -o %PPID ${daemname}`
if [ -z "${daempids}" ]
then
success ${daeminfo}
echo
/bin/rm -f ${lockfile}
[ -h "/var/run/named.pid" ] && /bin/rm -f "/var/run/named.pid"
return 0
fi
/bin/kill -s ${killsign} -- ${daempids}
done
done
failure ${daeminfo}
echo
return ${daemcode}
}
function status()
{
local exitcode="0"
${ctrlfile} status 2>/dev/null ; exitcode=${?}
[ ${exitcode} -eq 0 ] || echo "Can't bind to '${daemname}'"
}
function restart()
{
stop
start
}
function reload()
{
${ctrlfile} reload > /dev/null 2>&1 || killall -HUP ${daemfile}
}
function check()
{
if [ -n "${jailargs}" ]
then
${testfile} -t ${jailargs} ${conffile}
else
${testfile} ${conffile}
fi
}
function probe()
{
${ctrlfile} reload > /dev/null 2>&1 || start
return ${?}
}
function help()
{
local selfname=`basename ${0}`
echo $"Usage: ${selfname} {start|stop|status|restart|reload|check|probe}"
return 1
}
case "${1}" in
start) start
;;
stop) stop
;;
status) status
;;
restart) restart
;;
reload) reload
;;
check) check
;;
probe) probe
;;
*) help
;;
esac
exit ${?}