Running A MySQL-Based DNS Server: MyDNS - dnsctl error

Discussion in 'General' started by hurfi, Jul 25, 2008.

  1. hurfi

    hurfi New Member

    Hi,

    I've setup two servers running centos 5.2 with mydns/mydnsconfig and i'm now trying to get recursive lookups running.
    I'm following the guide but get stuck at the dnsctl setup. The first problem is that http://www.servershak.com/dns/dnsctl just 404's so that aint going to work. I found a post by Falko with the contents of dnsctl so i just created the file and pasted the contents into it.
    now when i try to run "chkconfig --levels 235 dnsctl on" i get "service dnsctl does not support chkconfig"

    Can anyone help me out?

    Cheers,

    Hurf
     
  2. falko

    falko Super Moderator ISPConfig Developer

    Did you make dnsctl executable? Can you post the contents of the mydns init script?
     
  3. hurfi

    hurfi New Member

    Hi Falko,

    It's executable for root:

    -rwx------ 1 root root 2122 Jul 23 14:20 dnsctl

    The my DNS init script looks like:

    [root@ns1 init.d]# cat mydns
    #!/bin/bash
    #
    # mydns This starts and stops mydns.
    #
    # chkconfig: 345 52 50
    # description: A database-driven DNS server
    #
    # processname: /usr/sbin/mydns
    # config: /etc/mydns.conf
    # pidfile: /var/run/mydns.pid

    PATH=/sbin:/bin:/usr/bin:/usr/sbin
    prog=mydns

    # Source function library.
    . /etc/init.d/functions

    [ -f /usr/sbin/mydns ] || exit 1
    [ -f /etc/mydns.conf ] || exit 1

    RETVAL=0

    start(){
    echo -n $"Starting $prog: "

    daemon $prog -b
    RETVAL=$?
    echo
    touch /var/lock/subsys/mydns
    return $RETVAL
    }

    stop(){
    echo -n $"Stopping $prog: "
    killproc $prog
    RETVAL=$?
    echo
    rm -f /var/lock/subsys/mydns
    return $RETVAL

    }

    restart(){
    stop
    start
    }

    condrestart(){
    [ -e /var/lock/subsys/mydns ] && restart
    return 0
    }


    # See how we were called.
    case "$1" in
    start)
    start
    ;;
    stop)
    stop
    ;;
    status)
    status $prog
    ;;
    restart|reload)
    restart
    ;;
    condrestart)
    condrestart
    ;;
    *)
    echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}"
    RETVAL=1
    esac

    exit $RETVAL







    And the contents of dnsctl look like:


    [root@ns1 sbin]# cat dnsctl
    #!/bin/sh

    # Don Walters
    # [email protected]
    #
    # chkconfig:
    # description: the djbdns DNS

    PATH=/bin:/usr/bin:/usr/local/bin:/usr/local/sbin
    export PATH

    case "$1" in
    start)
    echo "Starting dns"
    if svok /service/dnscache ; then
    svc -u /service/dnscache
    else
    echo dnscache service not running
    fi
    if svok /service/tinydns ; then
    svc -u /service/tinydns
    else
    echo tinydns service not running
    fi
    if [ -d /var/lock/subsys ]; then
    touch /var/lock/subsys/dns
    fi
    ;;
    stop)
    echo "Stopping dns ..."
    echo " dnscache"
    svc -d /service/dnscache
    echo " tinydns"
    svc -d /service/tinydns
    if [ -f /var/lock/subsys/dns ]; then
    rm /var/lock/subsys/dns
    fi
    ;;
    stat)
    svstat /service/dnscache
    svstat /service/dnscache/log
    echo "--"
    svstat /service/tinydns
    svstat /service/tinydns/log
    ;;
    reload|hup)
    echo "Sending HUP signal to dns."
    svc -h /service/dnscache
    svc -h /service/tinydns
    ;;
    pause)
    echo "Pausing dnscache"
    svc -p /service/dnscache
    echo "Pausing tinydns"
    svc -p /service/tinydns
    ;;
    cont)
    echo "Continuing dnscache"
    svc -c /service/dnscache
    echo "Continuing tinydns"
    svc -c /service/tinydns
    ;;
    restart)
    echo "Restarting dns:"
    echo "* Stopping dnscache."
    svc -d /service/dnscache
    echo "* Stopping tinydns."
    svc -d /service/tinydns
    echo "* Restarting dnscache."
    svc -u /service/dnscache
    echo "* Restarting tinydns."
    svc -u /service/tinydns
    ;;
    help)
    cat <<HELP
    start -- starts dns service (dns connections allowed. queries can go out)
    stop -- stops dns service (dns connections refused, nothing goes out)
    pause -- temporarily stops dns service (dns connections accepted, nothing leaves)
    cont -- continues paused dns service
    stat -- displays status of mail service
    restart -- stops and restarts dns
    reload -- sends dns HUP
    hup -- same as reload
    HELP
    ;;
    *)
    echo "Usage: $0 {start|stop|restart|reload|stat|pause|cont|help}"
    exit 1
    ;;
    esac

    exit 0
    [root@ns1 sbin]#



    Cheers,

    Hurf
     
  4. falko

    falko Super Moderator ISPConfig Developer

    Please replace
    Code:
    # chkconfig:
    with
    Code:
    # chkconfig: 345 52 50
    in the dnsctl script and try to run chkconfig again.
     
  5. hurfi

    hurfi New Member

    Hi Falko,

    That works...thank you

    BUT

    Now onto the next part of the guide when running make on ucspi-tcp-0.88 it errors with this:

    Code:
    ./load tcpserver rules.o remoteinfo.o timeoutconn.o cdb.a \
            dns.a time.a unix.a byte.a  `cat socket.lib`
    /usr/bin/ld: errno: TLS definition in /lib/libc.so.6 section .tbss mismatches non-TLS reference in tcpserver.o
    /lib/libc.so.6: could not read symbols: Bad value
    collect2: ld returned 1 exit status
    make: *** [tcpserver] Error 1
    [root@ns1 ucspi-tcp-0.88]#
    
    Can you possibly offer any further guidance?

    Regards,
     
    Last edited: Jul 31, 2008

Share This Page