<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
I do not use the version provided bu Debian because I am migrating from bind8 to Bind9 and I wan to have both versions available on the same server.<BR>
So, I want to have Bind9 totally separated from Bind8.<BR>
<BR>
I use Debian, version 5 and the last ESV bind9.<BR>
<BR>
- I have seen that in the debian distribution, bind9 is started via "named -u bind" ==> is it dangerous to run bind9 as root?<BR>
<BR>
- The following script is provided i nthe distribution to start/stop bind9.<BR>
But I hesitate to copy it to use it with a source installation.<BR>
<BR>
lennydnstest01:~# cat /etc/init.d/bind9<BR>#!/bin/sh<BR>
### BEGIN INIT INFO<BR># Provides: bind9<BR># Required-Start: $remote_fs<BR># Required-Stop: $remote_fs<BR># Should-Start: $network $syslog<BR># Should-Stop: $network $syslog<BR># Default-Start: 2 3 4 5<BR># Default-Stop: 0 1 6<BR># Short-Description: Start and stop bind9<BR># Description: bind9 is a Domain Name Server (DNS)<BR># which translates ip addresses to and from internet names<BR>### END INIT INFO<BR>
PATH=/sbin:/bin:/usr/sbin:/usr/bin<BR>
# for a chrooted server: "-u bind -t /var/lib/named"<BR># Don't modify this line, change or create /etc/default/bind9.<BR>OPTIONS=""<BR>RESOLVCONF=no<BR>
test -f /etc/default/bind9 && . /etc/default/bind9<BR>
test -x /usr/sbin/rndc || exit 0<BR>
. /lib/lsb/init-functions<BR>DISTRO=$(lsb_release -is 2>/dev/null || echo Debian)<BR>PIDFILE=/var/run/bind/run/named.pid<BR>
check_network() {<BR> if [ -x /usr/bin/uname ] && [ "X$(/usr/bin/uname -o)" = XSolaris ]; then<BR> IFCONFIG_OPTS="-au"<BR> else<BR> IFCONFIG_OPTS=""<BR> fi<BR> if [ -z "$(/sbin/ifconfig $IFCONFIG_OPTS)" ]; then<BR> #log_action_msg "No networks configured."<BR> return 1<BR> fi<BR> return 0<BR>}<BR>
case "$1" in<BR> start)<BR> log_daemon_msg "Starting domain name service..." "bind9"<BR>
modprobe capability >/dev/null 2>&1 || true<BR>
# dirs under /var/run can go away on reboots.<BR> mkdir -p /var/run/bind/run<BR> chmod 775 /var/run/bind/run<BR> chown root:bind /var/run/bind/run >/dev/null 2>&1 || true<BR>
if [ ! -x /usr/sbin/named ]; then<BR> log_action_msg "named binary missing - not starting"<BR> log_end_msg 1<BR> exit 1<BR> fi<BR>
if ! check_network; then<BR> log_end_msg 1<BR> exit 1<BR> fi<BR>
echo $OPTIONS;<BR>
if start-stop-daemon --start --oknodo --quiet --exec /usr/sbin/named \<BR> --pidfile ${PIDFILE} -- $OPTIONS; then<BR> if [ "X$RESOLVCONF" != "Xno" ] && [ -x /sbin/resolvconf ] ; then<BR> echo "nameserver 127.0.0.1" | /sbin/resolvconf -a lo.named<BR> fi<BR> log_end_msg 0<BR> else<BR> log_end_msg 1<BR> fi<BR> ;;<BR>
stop)<BR> log_daemon_msg "Stopping domain name service..." "bind9"<BR> if ! check_network; then<BR> log_end_msg 1<BR> exit 1<BR> fi<BR>
if [ "X$RESOLVCONF" != "Xno" ] && [ -x /sbin/resolvconf ] ; then<BR> /sbin/resolvconf -d lo.named<BR> fi<BR> pid=$(/usr/sbin/rndc stop -p | awk '/^pid:/ {print $2}')<BR> if [ -n "$pid" ]; then<BR> while kill -0 $pid 2>/dev/null; do<BR> log_progress_msg "waiting for pid $pid to die"<BR> sleep 1<BR> done<BR> fi<BR> log_end_msg $?<BR> ;;<BR>
reload|force-reload)<BR> log_daemon_msg "Reloading domain name service..." "bind9"<BR> if ! check_network; then<BR> log_end_msg 1<BR> exit 1<BR> fi<BR>
/usr/sbin/rndc reload >/dev/null<BR> log_end_msg $?<BR> ;;<BR>
restart)<BR> if ! check_network; then<BR> exit 1<BR> fi<BR>
$0 stop<BR> $0 start<BR> ;;<BR> <BR> status)<BR> ret=0<BR> status_of_proc -p ${PIDFILE} /usr/sbin/named bind9 2>/dev/null || ret=$?<BR> ;;<BR>
*)<BR> log_action_msg "Usage: /etc/init.d/bind9 {start|stop|reload|restart|force-reload|status}"<BR> exit 1<BR> ;;<BR>esac<BR>
exit 0<BR>
<BR>
<BR>
<BR> <BR>
> Date: Fri, 15 Apr 2011 16:24:09 +0200<BR>> From: uhlar@fantomas.sk<BR>> To: bind-users@lists.isc.org<BR>> Subject: Re: start script for bind9<BR>> <BR>> On 14.04.11 14:23, hugo hugoo wrote:<BR>> > I have installed bind9 using the make install procedure.<BR>> > It works but I did not find any startup script to could put in my<BR>> > /etc/init.d/ directory.<BR>> > <BR>> > I know that if bind is installed via apt-get install (I am using debian<BR>> > linux version), there is automatically a bind9 startup script in<BR>> > /etc/init.d/ directory.<BR>> <BR>> Why don't you use the version provided with debian?<BR>> <BR>> -- <BR>> Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/<BR>> Warning: I wish NOT to receive e-mail advertising to this address.<BR>> Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.<BR>> Chernobyl was an Windows 95 beta test site.<BR>> _______________________________________________<BR>> bind-users mailing list<BR>> bind-users@lists.isc.org<BR>> https://lists.isc.org/mailman/listinfo/bind-users<BR> </body>
</html>