Re: How to tell what is binding a port?
*- On 13 Oct, Pollywog wrote about "RE: How to tell what is binding a port?"
>
> On 13-Oct-99 Brian Servis wrote:
>>
>> Something is binding to port 139 which is what samba is trying to use
>> and thus smbd is failing to start. How can I track down what is bound
>> to the port? /etc/services points to netbios-ssn service which is what
>> smbd handles but I am getting the following errors in the smb logs:
>>
>> [1999/10/13 11:39:42, 0] lib/util_sock.c:open_socket_in(671)
>> bind failed on port 139 socket_addr=0.0.0.0 (Address already in use)
>>
>> Thanks for any pointers,
>
> What about 'fuser 139/tcp' or 'fuser 139/udp' ? That will give you the PID of
> the process using the port.
>
Ok, 'lsof -i tcp' didn't show anything but 'fuser 139/tcp' did.
And it shows that inetd has got port 139 bound.
# lsof -i tcp | grep 139
# fuser 139/tcp
139/tcp: 21747
# ps ax | grep 21747
21747 ? S 0:02 /usr/sbin/inetd
This makes sense to me as /etc/inetd.conf contains:
netbios-ssn stream tcp nowait root /usr/sbin/tcpd /usr/sbin/smbd
netbios-ns dgram udp wait root /usr/sbin/tcpd /usr/sbin/nmbd
and /etc/services contains:
netbios-ns 137/tcp # NETBIOS Name Service
netbios-ns 137/udp
netbios-dgm 138/tcp # NETBIOS Datagram Service
netbios-dgm 138/udp
netbios-ssn 139/tcp # NETBIOS session service
netbios-ssn 139/udp
But if I disable the netbios-ssn and netbios-ns services in inetd.conf
and start smbd in daemon mode it works. I have always been running smbd
and nmbd from inetd so what could have changed to cause this to fail?
Thanks,
Brian Servis
--
------------------------------------------------------------------------
Mechanical Engineering | Never criticize anybody until you
Purdue University | have walked a mile in their shoes,
servis@purdue.edu | because by that time you will be a
http://www.ecn.purdue.edu/~servis | mile away and have their shoes.
Reply to: