Hi ! Why almost always samba bind to tcp port left by apache (httpd) after apache shutdown ie I start httpd then smbd & nmbd, then I stop httpd and when I want to relaunch httpd it doesn't work because smbd has bound requiered port ! Here is a dump of netstat -nap when smbd has takeover needed port for httpd (2004 is a HTTP SSL port) : Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.1:143 127.0.0.1:1694 TIME_WAIT - tcp 0 0 127.0.0.1:1693 127.0.0.1:389 TIME_WAIT - tcp 0 0 127.0.0.1:110 127.0.0.1:1689 TIME_WAIT - tcp 0 0 127.0.0.1:1688 127.0.0.1:389 TIME_WAIT - tcp 106 0 172.20.50.1:2003 172.20.0.125:2757 CLOSE_WAIT - tcp 106 0 172.20.50.1:2003 172.20.0.125:2756 CLOSE_WAIT - tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN 21953/smbd tcp 1 0 127.0.0.1:1471 127.0.0.1:389 CLOSE_WAIT 21953/smbd tcp 1 0 127.0.0.1:1456 127.0.0.1:389 CLOSE_WAIT 21953/smbd tcp 0 0 127.0.0.1:389 127.0.0.1:1393 ESTABLISHED 164/slapd tcp 0 0 127.0.0.1:1393 127.0.0.1:389 ESTABLISHED 21953/smbd tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 21953/smbd tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 21953/smbd tcp 0 0 172.20.50.1:2003 0.0.0.0:* LISTEN 21953/smbd tcp 0 127 172.20.50.1:23 172.20.0.125:1759 ESTABLISHED 5321/in.telnetd tcp 0 0 127.0.0.1:2583 0.0.0.0:* LISTEN 7558/mon tcp 0 0 127.0.0.1:389 127.0.0.1:1299 ESTABLISHED 164/slapd tcp 0 0 127.0.0.1:1299 127.0.0.1:389 ESTABLISHED 6630/lcd tcp 0 0 0.0.0.0:23 0.0.0.0:* LISTEN 488/inetd tcp 0 0 127.0.0.1:389 127.0.0.1:1044 ESTABLISHED 164/slapd tcp 0 0 127.0.0.1:1044 127.0.0.1:389 ESTABLISHED 3807/ tcp 0 0 0.0.0.0:113 0.0.0.0:* LISTEN 488/inetd tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN 488/inetd tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN 488/inetd tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 488/inetd tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 442/ tcp 0 0 0.0.0.0:389 0.0.0.0:* LISTEN 164/slapd udp 0 0 192.168.1.1:138 0.0.0.0:* 21964/nmbd udp 0 0 192.168.1.1:137 0.0.0.0:* 21964/nmbd udp 0 0 172.20.50.1:138 0.0.0.0:* 21964/nmbd udp 0 0 172.20.50.1:137 0.0.0.0:* 21964/nmbd udp 0 0 0.0.0.0:138 0.0.0.0:* 21964/nmbd udp 0 0 0.0.0.0:137 0.0.0.0:* 21964/nmbd udp 0 0 127.0.0.1:2583 0.0.0.0:* 7558/mon udp 0 0 0.0.0.0:111 0.0.0.0:* 442/ raw 0 0 0.0.0.0:1 0.0.0.0:* 7 - raw 0 0 0.0.0.0:6 0.0.0.0:* 7 - Is there a option to lock some TCP port to prevent samba taking them ? thank you -- Vyskocil Vladimir vyskocil@unice.fr
Vladimir, On Tue, 03 Oct 2000 16:23:12 +0200, Vladimir Vyskocil wrote:>Why almost always samba bind to tcp port left by apache (httpd) >after apache shutdown ie I start httpd then smbd & nmbd, then I stop >httpd and when I want to relaunch httpd it doesn't work because smbd >has bound requiered port ! Here is a dump of netstat -nap when smbd >has takeover needed port for httpd (2004 is a HTTP SSL port) :First: 2003 (guess you mean this one instead of 2004) is really a bad choice for any server to listen on a busy machine, it will almost always collide with dynamically assigned ports. Try ports below 1024 for your servers. If I shorten your netstat output a little, I get the following: - ESTABLISHED 21953/smbd 127.0.0.1:1393 127.0.0.1:389 Ok, that's Samba connecting to your LDAP server. - LISTEN 21953/smbd 0.0.0.0:139 0.0.0.0:* 0.0.0.0:80 0.0.0.0:* 0.0.0.0:443 0.0.0.0:* 172.20.50.1:2003 0.0.0.0:* Well, that's really a funny process: your smbd seems to listen for NETBIOS sessions (139, that's ok) as well as for HTTP (80) and HTTPS (443). How come? I never saw this on any of my machines. Which OS/version are you running? Which Samba version? Which parameters did you give to ./configure? Can you post your smb.conf? Your startup parameters? Do you have lsof for your architecture? Can you do an 'lsof -p xxx' with xxx being smbd' PID? I have a feeling your OS messes some things up. :-) Regards, Robert -- --------------------------------------------------------------- Robert.Dahlem@gmx.net Fax +49-69-432647 --------------------------------------------------------------- Sent using PMMail (http://www.pmmail2000.com) - fast, decent, email software; far better than Outlook. Try it sometime.