The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Getting BIND(dns) to restart automatically

Discussion in 'Bind / DNS / Nameserver Issues' started by AbeFroman, Feb 21, 2002.

  1. AbeFroman

    AbeFroman BANNED

    Joined:
    Feb 16, 2002
    Messages:
    654
    Likes Received:
    1
    Trophy Points:
    0
    hello,

    when mysql or apache goes down i get this message
    mysql failed @ Wed Feb 20 23:08:23 2002. A restart was attempted automagicly. or apache failed @ Wed Feb 20 23:08:16 2002. A restart was attempted automagicly.

    but when BIND(dns) went down i got this message
    The hostname (server100.anhosting.com) resolves to . It should resolve to 66.96.228.70. Please be sure to correct /etc/hosts as well as the 'A' entry in zone file for the domain.

    Is that the message meaning BIND is down? When BIND in server status is down is there anyway it can restart automatically?
     
  2. feanor

    feanor Well-Known Member

    Joined:
    Aug 13, 2001
    Messages:
    836
    Likes Received:
    0
    Trophy Points:
    16
    First correct /etc/hosts ......
    http://support.cpanel.net/obb/read.php?TID=1346

    /scripts/ipcheck will give you some more specifics as well-

    You can write a cron that checks if named is running every minute and then have it restart it if it finds it is not.
    (/etc/rc.d/init.d/named restart)

    I don't understand why the nameserver would crash without any details in /var/log/messages or /var/log/bind , however- there should be some details somewhere.
     
  3. AbeFroman

    AbeFroman BANNED

    Joined:
    Feb 16, 2002
    Messages:
    654
    Likes Received:
    1
    Trophy Points:
    0
    more info please

    How do i check to see if i BIND is running, for writing the cron?
    if((/etc/rc.d/init.d/named == 1)????
     
  4. feanor

    feanor Well-Known Member

    Joined:
    Aug 13, 2001
    Messages:
    836
    Likes Received:
    0
    Trophy Points:
    16
    Better would be to check if it is actually a running process
    ps aux | grep named --- then.... take action, etc.

    That is much, much safer way of doing this....
     
  5. AbeFroman

    AbeFroman BANNED

    Joined:
    Feb 16, 2002
    Messages:
    654
    Likes Received:
    1
    Trophy Points:
    0
    whats aux?

    aux,

    what does that mean?
     
  6. feanor

    feanor Well-Known Member

    Joined:
    Aug 13, 2001
    Messages:
    836
    Likes Received:
    0
    Trophy Points:
    16
    those are flags for the process command.
    a linux sys admin how-to book would be helpful at this point.

    or type &man ps&
     
  7. Keegan

    Keegan Well-Known Member

    Joined:
    Oct 22, 2001
    Messages:
    110
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    DataCenter Provider
    create a file here /etc/chkserv.d/named with service[named]=nslookup,x,x,/etc/init.d/named restart in it, this will automatically restart bind on fail.
     
  8. cheapo

    cheapo Member

    Joined:
    Sep 6, 2002
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    smae thing, only different

    i'm having the same problem with apache not restarting. Would this same kind of thing work for me? If so, can you tell me step by step how to do it. (keeping in mind that i'm still waiting for the "cpanel for dummies" book to come out). I learn so much here!! :)
     
  9. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    Listing of chkserv.d files locate in /etc/chkserv.d

    FOR APACHE:
    #SERVICE = PORT, SEND, RESPONSE, RESTART COMMAND
    service[apache]=80,GET / HTTP/1.0,HTTP/1..,/scripts/checkmaxclients;killall -TERM httpd;sleep 2;killall -9 httpd;/etc/rc.d/init.d/httpd stop;/etc/rc.d/init.d/httpd startssl;/usr/local/apache/bin/apachectl startssl;/etc/rc.d/init.d/httpd_start;/usr/local/apache/bin/apachectl start

    FOR BIND:
    #SERVICE = PORT, SEND, RESPONSE, RESTART COMMAND
    service[bind]=x,x,x,/scripts/restartsrv bind,named,named|root|bind

    FOR EXIM:
    #SERVICE = PORT, SEND, RESPONSE, RESTART COMMAND
    service[exim]=25,QUIT,220,/etc/rc.d/init.d/exim stop;/etc/rc.d/init.d/exim stop;/etc/rc.d/init.d/exim stop;/etc/rc.d/init.d/exim start
    service[imap]=143,A001 LOGOUT,* OK,/scripts/restartsrv imap

    FOR INTERCHANGE:
    #SERVICE = PORT, SEND, RESPONSE, RESTART COMMAND
    service[interchange]=x,x,x,/usr/local/cpanel/bin/startinterchange,interchange,cpanel

    FOR MYSQL:
    #SERVICE = PORT, SEND, RESPONSE, RESTART COMMAND
    service[mysql]=x,x,x,/scripts/restartsrv mysql,mysqld_safe|safe_mysqld,mysql|root

    FOR FTP:
    #SERVICE = PORT, SEND, RESPONSE, RESTART COMMAND
    service[ftpd]=21,QUIT,220,/scripts/restartsrv ftpserver

    FOR SYSLOGS:
    #SERVICE = PORT, SEND, RESPONSE, RESTART COMMAND
    service[syslogd]=x,x,x,/scripts/restartsrv syslogd,syslogd,root

    FOR TOMCAT: **REQUIRES EXTRA TOMCAT CONFIGURATION AS WELL
    #SERVICE = PORT, SEND, RESPONSE, RESTART COMMAND
    service[Tomcat_JSP]=8082,GET / HTTP/1.0,HTTP/1..,/usr/sbin/stoptomcat;/usr/sbin/starttomcat

    FOR WEBMAIL:
    #SERVICE = PORT, SEND, RESPONSE, RESTART COMMAND
    service[webmail]=2095,GET / HTTP/1.0,HTTP/1..,/scripts/ckillall -9 webmaild;/usr/local/cpanel/webmaild
     
Loading...

Share This Page