Two named processes running

Discussion in 'Server Operation' started by atjensen11, Dec 11, 2007.

  1. atjensen11

    atjensen11 New Member

    Hello,

    I followed this How-To (http://www.howtoforge.com/perfect_server_ubuntu7.10_p4). However, I also installed Webmin.

    The only part where I deviated from the How-To was during the installation. I accidently installed BIND during the installation of Ubuntu when the How-To called for only installing OpenSSH. (page 2 of the install)

    I now have a problem where there are two named processes that are typically running at once.

    After a cold boot, there is one named process that is running. If I issue a "/etc/init.d/bind9 stop", the process is killed and no longer present. Conversely, the command "/etc/init.d/bind9 start" brings the process back to life.

    Browsing into Webmin though, the BIND Server page does not report the server as running even though the named process is running. The same is true in the System & Server Status page in Webmin. It reports BIND as down. If I click on "Start Server" in the BIND Server page, I now have two named processes running.

    In order to configure the nameserver, I really need to know which is which. I really don't know if I have two versions installed or am just starting two processes from the same installation.

    Either way, I would really appreciate help in troubleshooting this process. After every boot, I have to manually shut one down and start the other.

    FYI - there are no errors in the syslog

    Thanks,
    Tom
     
  2. falko

    falko Super Moderator Howtoforge Staff

    What are the outputs of
    Code:
    ps aux
    and
    Code:
    netstat -tap
    ?
     
  3. atjensen11

    atjensen11 New Member

    Output of ps aux
    Code:
    USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
    root         1  0.0  0.2   2948  1852 ?        Ss   Dec10   0:01 /sbin/init
    root         2  0.0  0.0      0     0 ?        S<   Dec10   0:00 [kthreadd]
    root         3  0.0  0.0      0     0 ?        S<   Dec10   0:00 [migration/0]
    root         4  0.0  0.0      0     0 ?        SN   Dec10   0:00 [ksoftirqd/0]
    root         5  0.0  0.0      0     0 ?        S<   Dec10   0:00 [watchdog/0]
    root         6  0.0  0.0      0     0 ?        S<   Dec10   0:00 [events/0]
    root         7  0.0  0.0      0     0 ?        S<   Dec10   0:00 [khelper]
    root        26  0.0  0.0      0     0 ?        S<   Dec10   0:00 [kblockd/0]
    root        27  0.0  0.0      0     0 ?        S<   Dec10   0:00 [kacpid]
    root        28  0.0  0.0      0     0 ?        S<   Dec10   0:00 [kacpi_notify]
    root        91  0.0  0.0      0     0 ?        S<   Dec10   0:00 [kseriod]
    root       110  0.0  0.0      0     0 ?        S    Dec10   0:00 [pdflush]
    root       111  0.0  0.0      0     0 ?        S    Dec10   0:00 [pdflush]
    root       112  0.0  0.0      0     0 ?        S<   Dec10   0:00 [kswapd0]
    root       164  0.0  0.0      0     0 ?        S<   Dec10   0:00 [aio/0]
    root      1844  0.0  0.0      0     0 ?        S<   Dec10   0:00 [ksuspend_usbd]
    root      1845  0.0  0.0      0     0 ?        S<   Dec10   0:00 [khubd]
    root      1865  0.0  0.0      0     0 ?        S<   Dec10   0:00 [ata/0]
    root      1867  0.0  0.0      0     0 ?        S<   Dec10   0:00 [ata_aux]
    root      1967  0.0  0.0      0     0 ?        S<   Dec10   0:00 [scsi_eh_0]
    root      1968  0.0  0.0      0     0 ?        S<   Dec10   0:00 [scsi_eh_1]
    root      2155  0.0  0.0      0     0 ?        S<   Dec10   0:01 [kjournald]
    root      2315  0.0  0.1   2320   668 ?        S<s  Dec10   0:00 /sbin/udevd --d
    root      3202  0.0  0.0      0     0 ?        S<   Dec10   0:00 [kpsmoused]
    root      5488  0.0  0.0   1692   516 tty4     Ss+  Dec10   0:00 /sbin/getty 384
    root      5489  0.0  0.0   1696   520 tty5     Ss+  Dec10   0:00 /sbin/getty 384
    root      5492  0.0  0.0   1696   520 tty2     Ss+  Dec10   0:00 /sbin/getty 384
    root      5493  0.0  0.0   1696   520 tty3     Ss+  Dec10   0:00 /sbin/getty 384
    root      5494  0.0  0.0   1692   516 tty1     Ss+  Dec10   0:00 /sbin/getty 384
    root      5495  0.0  0.0   1696   516 tty6     Ss+  Dec10   0:00 /sbin/getty 384
    syslog    5543  0.0  0.1   1912   736 ?        Rs   Dec10   0:01 /sbin/syslogd -
    root      5562  0.0  0.0   1836   536 ?        S    Dec10   0:00 /bin/dd bs 1 if
    klog      5564  0.0  0.2   2600  1408 ?        Ss   Dec10   0:00 /sbin/klogd -P
    root      5612  0.0  0.1   5280   972 ?        Ss   Dec10   0:00 /usr/sbin/sshd
    virtual   5647  0.0  7.3  55300 47264 ?        Ss   Dec10   0:01 amavisd (master
    root      5679  0.0  0.0   1752   528 ?        S    Dec10   0:00 /bin/sh /usr/bi
    mysql     5719  0.0  1.1  46536  7712 ?        Sl   Dec10   0:00 /usr/sbin/mysql
    root      5720  0.0  0.0   1676   548 ?        S    Dec10   0:00 logger -p daemo
    postgrey  5779  0.0  1.2  10840  8068 ?        Ss   Dec10   0:00 /usr/sbin/postg
    root      6133  0.0  0.0   1864   432 ?        S    Dec10   0:00 /usr/sbin/couri
    root      6134  0.0  0.1   4388  1080 ?        S    Dec10   0:00 /usr/lib/courie
    root      6149  0.0  0.0   1868   432 ?        S    Dec10   0:00 /usr/sbin/couri
    root      6150  0.0  0.0   1972   612 ?        S    Dec10   0:00 /usr/sbin/couri
    root      6169  0.0  0.0   1868   352 ?        S    Dec10   0:00 /usr/sbin/couri
    root      6170  0.0  0.0   1972   592 ?        S    Dec10   0:00 /usr/sbin/couri
    root      6181  0.0  0.2   4432  1300 ?        S    Dec10   0:00 /usr/lib/courie
    root      6183  0.0  0.2   4432  1300 ?        S    Dec10   0:00 /usr/lib/courie
    root      6184  0.0  0.2   4432  1300 ?        S    Dec10   0:00 /usr/lib/courie
    root      6185  0.0  0.2   4432  1300 ?        S    Dec10   0:00 /usr/lib/courie
    root      6186  0.0  0.2   4432  1300 ?        S    Dec10   0:00 /usr/lib/courie
    root      6188  0.0  0.0   1968   528 ?        S    Dec10   0:00 /usr/sbin/couri
    root      6191  0.0  0.0   1732   344 ?        S    Dec10   0:00 /usr/sbin/couri
    root      6209  0.0  0.0   1868   352 ?        S    Dec10   0:00 /usr/sbin/couri
    root      6210  0.0  0.0   1972   592 ?        S    Dec10   0:00 /usr/sbin/couri
    root      6215  0.0  0.6   6292  4344 ?        S    Dec10   0:06 ddclient - slee
    root      6276  0.0  0.2   5324  1668 ?        Ss   Dec10   0:00 /usr/lib/postfi
    postfix   6281  0.0  0.2   5372  1784 ?        S    Dec10   0:00 qmgr -l -t fifo
    postfix   6282  0.0  0.3   5652  2388 ?        S    Dec10   0:00 tlsmgr -l -t un
    root      6293  0.0  0.2   6416  1312 ?        Ss   Dec10   0:00 /usr/sbin/nmbd
    root      6295  0.0  0.3   9900  2228 ?        Ss   Dec10   0:00 /usr/sbin/smbd
    root      6309  0.0  0.1   9900   912 ?        S    Dec10   0:00 /usr/sbin/smbd
    root      6310  0.0  0.1   7456   752 ?        Ss   Dec10   0:00 /usr/sbin/sasla
    root      6312  0.0  0.0   7456   480 ?        S    Dec10   0:00 /usr/sbin/sasla
    root      6313  0.0  0.0   7456   364 ?        S    Dec10   0:00 /usr/sbin/sasla
    root      6314  0.0  0.0   7456   364 ?        S    Dec10   0:00 /usr/sbin/sasla
    root      6315  0.0  0.0   7456   364 ?        S    Dec10   0:00 /usr/sbin/sasla
    root      6327  0.0  0.2   7988  1296 ?        Ss   Dec10   0:00 /usr/sbin/winbi
    root      6376  0.0  0.1   7988  1076 ?        S    Dec10   0:00 /usr/sbin/winbi
    ntp       6388  0.0  0.1   4108  1248 ?        Ss   Dec10   0:00 /usr/sbin/ntpd
    proftpd   6407  0.0  0.2   9500  1528 ?        Ss   Dec10   0:00 proftpd: (accep
    daemon    6421  0.0  0.0   1964   432 ?        Ss   Dec10   0:00 /usr/sbin/atd
    root      6432  0.0  0.1   2332   908 ?        Ss   Dec10   0:00 /usr/sbin/cron
    root      6454  0.0  0.9  21880  6420 ?        Ss   Dec10   0:00 /usr/sbin/apach
    www-data  6486  0.0  1.3  23852  8440 ?        S    Dec10   0:00 /usr/sbin/apach
    www-data  6487  0.0  0.6  21904  4492 ?        S    Dec10   0:00 /usr/sbin/apach
    www-data  6488  0.0  0.6  21904  4476 ?        S    Dec10   0:00 /usr/sbin/apach
    www-data  6489  0.0  0.6  21904  4452 ?        S    Dec10   0:00 /usr/sbin/apach
    www-data  6490  0.0  0.6  21904  4480 ?        S    Dec10   0:00 /usr/sbin/apach
    root      6491  0.0  1.0  10316  6528 ?        Ss   Dec10   0:00 /usr/bin/perl /
    bind      8013  0.0  3.0  47588 19648 ?        Ssl  Dec10   0:01 /usr/sbin/named
    www-data 11827  0.0  1.2  22784  7984 ?        S    Dec11   0:00 /usr/sbin/apach
    virtual  13789  0.0  8.1  63100 52420 ?        Ss   Dec11   0:04 /usr/sbin/clamd
    root     14050  0.0  3.4  50380 22440 ?        Ssl  Dec11   0:02 /usr/sbin/named
    www-data 16921  0.0  0.6  21904  4492 ?        S    Dec11   0:00 /usr/sbin/apach
    virtual  25677  0.0  7.3  56340 47380 ?        S    12:00   0:00 amavisd (ch1-av
    virtual  25839  0.0  7.3  56344 47368 ?        S    12:18   0:00 amavisd (ch1-av
    postfix  26025  0.0  0.2   5332  1668 ?        S    12:45   0:00 pickup -l -t fi
    root     26558  0.0  0.3   8032  2412 ?        Ss   14:04   0:00 sshd: hidden [
    hidden  26560  0.0  0.2   8032  1524 ?        S    14:04   0:00 sshd: hidden@p
    hidden  26561  0.2  0.4   5588  2944 pts/0    Ss   14:04   0:00 -bash
    root     26602  1.0  0.1   2620  1000 pts/0    R+   14:05   0:00 ps aux
    
    Output of netstat -tap
    Code:
    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
    tcp        0      0 localhost:60000         *:*                     LISTEN     5779/postgrey.pid -
    tcp        0      0 localhost:10024         *:*                     LISTEN     5647/amavisd (maste
    tcp        0      0 localhost:10025         *:*                     LISTEN     6276/master
    tcp        0      0 localhost:mysql         *:*                     LISTEN     5719/mysqld
    tcp        0      0 *:netbios-ssn           *:*                     LISTEN     6295/smbd
    tcp        0      0 *:submission            *:*                     LISTEN     6276/master
    tcp        0      0 *:webmin                *:*                     LISTEN     6491/perl
    tcp        0      0 *:ssmtp                 *:*                     LISTEN     6276/master
    tcp        0      0 gopher.hidden *:*                     LISTEN     8013/named
    tcp        0      0 localhost:domain        *:*                     LISTEN     8013/named
    tcp        0      0 *:ftp                   *:*                     LISTEN     6407/proftpd: (acce
    tcp        0      0 gopher.hidden:ssh *:*                     LISTEN     5612/sshd
    tcp        0      0 localhost:953           *:*                     LISTEN     8013/named
    tcp        0      0 *:smtp                  *:*                     LISTEN     6276/master
    tcp        0      0 *:microsoft-ds          *:*                     LISTEN     6295/smbd
    tcp        0   2076 hidden:ssh hidden:48285 ESTABLISHED26558/sshd: hidden
    tcp6       0      0 *:imaps                 *:*                     LISTEN     6170/couriertcpd
    tcp6       0      0 *:pop3s                 *:*                     LISTEN     6210/couriertcpd
    tcp6       0      0 *:pop3                  *:*                     LISTEN     6188/couriertcpd
    tcp6       0      0 *:imap2                 *:*                     LISTEN     6150/couriertcpd
    tcp6       0      0 *:www                   *:*                     LISTEN     6454/apache2
    tcp6       0      0 *:domain                *:*                     LISTEN     8013/named
    tcp6       0      0 ip6-localhost:953       *:*                     LISTEN     8013/named
    
    
     
  4. falko

    falko Super Moderator Howtoforge Staff

    Hm, are there any errors related to BIND in your logs?
     
  5. atjensen11

    atjensen11 New Member

    Results of syslog

    I checked the syslog and I don't see any errors really. I haven't configured anything other than the installation (i.e. no zone files have been created).

    Code:
    Dec  8 08:23:49 gopher kernel: [   19.247453] TCP bind hash table entries: 65536 (order: 7, 524288 bytes)
    Dec  8 08:23:49 gopher kernel: [   19.248340] TCP: Hash tables configured (established 131072 bind 65536)
    Dec  8 08:23:51 gopher named[5561]: starting BIND 9.4.1-P1 -u bind -t /var/lib/named
    Dec  8 08:23:51 gopher named[5561]: loading configuration from '/etc/bind/named.conf'
    Dec  8 08:23:55 gopher amavis[5618]: Net::Server: Binding to UNIX socket file /var/run/amavis/amavisd.sock using SOCK_STREAM
    Dec  8 08:23:55 gopher amavis[5618]: Net::Server: Binding to TCP port 10024 on host 127.0.0.1
    Dec  8 08:23:59 gopher postgrey[5750]: Binding to TCP port 60000 on host 127.0.0.1  
    Dec  8 08:28:35 gopher named[6626]: starting BIND 9.4.1-P1 -c /etc/bind/named.conf
    Dec  8 08:28:35 gopher named[6626]: loading configuration from '/etc/bind/named.conf'
    Dec  8 08:28:35 gopher named[6626]: binding TCP socket: address in use
    Dec  8 08:28:35 gopher named[6626]: binding TCP socket: address in use
    Dec  8 08:28:35 gopher named[6626]: binding TCP socket: address in use
    Dec  8 08:28:35 gopher named[6626]: none:0: open: /etc/bind/rndc.key: permission denied
    Dec  8 08:28:35 gopher named[6626]: none:0: open: /etc/bind/rndc.key: permission denied
    Dec 10 18:38:47 gopher kernel: [   19.107016] TCP bind hash table entries: 65536 (order: 7, 524288 bytes)
    Dec 10 18:38:47 gopher kernel: [   19.107905] TCP: Hash tables configured (established 131072 bind 65536)
    Dec 10 18:38:49 gopher named[5590]: starting BIND 9.4.1-P1 -u bind -t /var/lib/named
    Dec 10 18:38:49 gopher named[5590]: loading configuration from '/etc/bind/named.conf'
    Dec 10 18:38:53 gopher amavis[5647]: Net::Server: Binding to UNIX socket file /var/run/amavis/amavisd.sock using SOCK_STREAM
    Dec 10 18:38:53 gopher amavis[5647]: Net::Server: Binding to TCP port 10024 on host 127.0.0.1
    Dec 10 18:38:57 gopher postgrey[5779]: Binding to TCP port 60000 on host 127.0.0.1  
    Dec 10 21:34:11 gopher named[7849]: starting BIND 9.4.1-P1 -u bind -t /var/lib/named
    Dec 10 21:34:11 gopher named[7849]: loading configuration from '/etc/bind/named.conf'
    Dec 10 21:44:10 gopher named[8013]: starting BIND 9.4.1-P1 -u bind -t /var/lib/named
    Dec 10 21:44:10 gopher named[8013]: loading configuration from '/etc/bind/named.conf'
    Dec 11 08:34:40 gopher named[14050]: starting BIND 9.4.1-P1 -c /etc/bind/named.conf
    Dec 11 08:34:40 gopher named[14050]: loading configuration from '/etc/bind/named.conf'
    Dec 11 08:34:40 gopher named[14050]: binding TCP socket: address in use
    Dec 11 08:34:40 gopher named[14050]: binding TCP socket: address in use
    Dec 11 08:34:40 gopher named[14050]: binding TCP socket: address in use
    Dec 11 08:34:40 gopher named[14050]: none:0: open: /etc/bind/rndc.key: permission denied
    Dec 11 08:34:40 gopher named[14050]: none:0: open: /etc/bind/rndc.key: permission denied
    
     
  6. falko

    falko Super Moderator Howtoforge Staff

    What's the output of
    Code:
    ls -l /etc/bind/rndc.key
    ?
     
  7. atjensen11

    atjensen11 New Member

    Permission on rndc.key

    Here are the results you asked for:

    Code:
    -rw-r----- 1 bind bind 77 2007-10-28 21:46 /etc/bind/rndc.key
    
    I really don't mind if I were to uninstall them both and start over. I just don't know where to find both of them.

    Thanks,
    Tom
     
  8. atjensen11

    atjensen11 New Member

    Uninstall and Reinstall

    I performed the command
    Code:
    apt-get remove --purge bind9
    It appeared that everything was removed successfully except some of the zone files under the /var/lib/named directory.

    Then I started over. I performed the command
    Code:
    apt-get install bind9
    After doing so, I issued a few start and stop commands by using
    Code:
    /etc/init.d/bind9 stop
    and
    Code:
    /etc/init.d/bind9 start
    After each time, Webmin reported the server up or down exactly how my SSH was reporting the status. So it appears that the two are in sync and that there is only one process running when I checked
    Code:
    netstat -tap
    and
    Code:
    ps -aux
    after each start command and no processes were running when I issued the stop command.

    Then I moved through the How To again to chroot the BIND process. These are the commands I issued:

    Code:
    hidden@gopher:~$ sudo /etc/init.d/bind9 stop
     * Stopping domain name service... bind                                                                     [ OK ]
    hidden@gopher:~$ sudo vi /etc/default/bind9
    hidden@gopher:~$ sudo mkdir -p /var/lib/named/etc
    hidden@gopher:~$ sudo mkdir /var/lib/named/dev
    hidden@gopher:~$ sudo mkdir -p /var/lib/named/var/cache/bind
    hidden@gopher:~$ sudo mkdir -p /var/lib/named/var/run/bind/run
    hidden@gopher:~$ sudo mv /etc/bind /var/lib/named/etc
    hidden@gopher:~$ sudo ln -s /var/lib/named/etc/bind /etc/bind
    hidden@gopher:~$ sudo mknod /var/lib/named/dev/null c 1 3
    hidden@gopher:~$ sudo mknod /var/lib/named/dev/random c 1 8
    hidden@gopher:~$ sudo chmod 666 /var/lib/named/dev/null /var/lib/named/dev/random
    hidden@gopher:~$ sudo chown -R bind:bind /var/lib/named/var/*
    hidden@gopher:~$ sudo chown -R bind:bind /var/lib/named/etc/bind
    hidden@gopher:~$ sudo vi /etc/default/syslogd
    hidden@gopher:~$ sudo /etc/init.d/sysklogd restart
     * Restarting system log daemon...                                                                          [ OK ]
    hidden@gopher:~$ sudo /etc/init.d/bind9 start
     * Starting domain name service... bind                                                                     [fail]
    
    I checked the syslog log file after the above error and this was the result:

    Code:
    Dec 15 12:20:18 gopher named[6977]: starting BIND 9.4.1-P1 -u bind -t /var/lib/named
    Dec 15 12:20:18 gopher named[6977]: found 1 CPU, using 1 worker thread
    Dec 15 12:20:18 gopher named[6977]: loading configuration from '/etc/bind/named.conf'
    Dec 15 12:20:18 gopher named[6977]: none:0: open: /etc/bind/named.conf: file not found
    Dec 15 12:20:18 gopher named[6977]: loading configuration: file not found
    Dec 15 12:20:18 gopher named[6977]: exiting (due to fatal error)
    
     
  9. falko

    falko Super Moderator Howtoforge Staff

    Did you create this symlink?
    Code:
    ln -s /var/lib/named/etc/bind /etc/bind
    Before you did the reinstall, it would have been enough to change /etc/bind/rndc.key's permissions...
     
  10. atjensen11

    atjensen11 New Member

    Confirmed

    The symlink was created. It was seven or eight lines into the commands in my previous post. I double checked through the Webmin File Manager and it shows the symlink icon as well.

    I am rather new to Linux and symlinks. If I understand the command shown in the How To, we are creating a "shortcut" pointing to /etc/bind.

    That would explain why I see the symlink icon in the file manager under /var/lib/named. But I also see a symlink icon for "bind" under /etc/. I don't have a separate folder called "bind" because I think we moved it as part of the How To.

    Does this seem correct?

    Lastly, what should the permissions be on the rndc.key file anyway?
     
  11. falko

    falko Super Moderator Howtoforge Staff

    Try 644 (chmod 644 /etc/bind/rndc.key).
     
  12. atjensen11

    atjensen11 New Member

    Webmin now in Sync

    I discovered in the Wemin Module Configuration for the BIND DNS Server that I had to use a custom path to the PID file location. This ended up being:

    Code:
    /var/lib/named/var/run/bind/run
    
    This now has Webmin reporting the BIND server status (up/down) the same as using netstat or start/stop with /etc/init.d/bind9.

    I am still working on the permissions of the key.
     

Share This Page