Next, the daemons have to be registered with the operating system so they can get access to TCP/IP ports. The
netstat
command will tell you if this has been done. Run the command
netstat
-a
on the server, and look for lines mentioning
netbios
,
137
or
139
:
server%
netstat -a
Active Internet connections (including servers)
Proto Recv-Q Send-Q Local Address Foreign Address (state)
udp 0 0 *.netbios- *.*
tcp 0 0 *.netbios- *.* LISTEN
tcp 8370 8760 server.netbios- client.1439
ESTABLISHED
or:
server%
netstat -a
Active Internet connections (including servers)
Proto Recv-Q Send-Q Local Address Foreign Address (state)
udp 0 0 *.137 *.*
tcp 0 0 *.139 *.* LISTEN
tcp 8370 8760 server.139 client.1439 ESTABLISHED
Among many similar lines, there should be at least one UDP line for
*.netbios-
or
*.137
. This indicates that the
nmbd server is registered and (we hope) is waiting to answer requests. There should also be at least one TCP line mentioning
*.netbios-
or
*.139
, and it will probably be in the LISTENING state. This means that
smbd is up and listening for connections.
There may be other TCP lines indicating connections from
smbd to clients, one for each client. These are usually in the ESTABLISHED state. If there are
smbd lines in the ESTABLISHED state,
smbd is definitely running. If there is only one line in the LISTENING state, we're not sure yet. If both of the lines is missing, a daemon has not succeeded in starting, so it's time to check the logs and then go back to Chapter 2.
If there is a line for each client, it may be coming either from a Samba daemon or from the master IP daemon,
inetd. It's quite possible that your
inetd startup file contains lines that start Samba daemons without your realizing it; for instance, the lines may have been placed there if you installed Samba as part of a Linux distribution. The daemons started by
inetd prevent ours from running. This problem typically produces log messages such as "bind failed on port 139 socket_addr=0 (Address already in use)."
Check your
/etc/inetd.conf ; unless you're intentionally starting the daemons from there, there
must not be any
netbios-ns
(udp port 137) or
netbios-ssn
(tcp port 139) servers mentioned there.
inetd is a daemon that provides numerous services, controlled by entries in
/etc/inetd.conf. If your system is providing an SMB daemon via
inetd, there will be lines like the following in the file:
netbios-ssn stream tcp nowait root /usr/local/samba/bin/smbd smbd
netbios-ns dgram udp wait root /usr/local/samba/bin/nmbd nmbd