On Fri, 22 Jan 1999, Sherine wrote:
> Hello Morning
> In the /etc/services file on my linux machine the smtp was define to be
> running on port 25....but then the error occurs which says that something
> else is using this port.
yeah right port number 25 is associated by default to the smtp server
anyway.. if you are suspecting that sth strange occurs to your box try to
analize the traffic using tcpdump or sniffit
(for a more exaustive list of port numbers, service and protocol see also
RFC1700 (ASSIGNED NUMBERS))
>
>
> If I put it on another port however like 26 evrything seems to be
> alright...How can I fing out what is using 25?
there are many ways
IMHO the most easier way to do it is
fuser -n <proto> <portnumber>
(eg fuser -n tcp 25)
fuser will tell you the PID of the process that use the selected port
so grep the `ps nauxw' output looking for the process with the PID
returned by fuser
/proc fs can also help you
catting /proc/net/tcp (or /proc/net/udp for udp based services) will tell
you many infos about networking (eg local address:port and remot
address:port, uid of the process, the queue state, the inode used etc.)
the infos are in hex format so port 25 will be 0019
using proc fs, or ps and netstat, you can associate inodes (the network
ones start with [0000]) and relative cmdline
BTW.. some time ago doing ftp in passive mode i noticed that some
*unprivileged* ports, after been binded, remain opened also after the
process has been closed.. (eg it happend with lynx and also during an dcc
session using irc)
the problem could stay in the way is called listen(2) system call;
the queue limit for incoming connections, probably, is grater then the
necessary (in this case sth like `listen(s, 0)' will fix the problem)
IMHO
AFAIK after a timeout or when the queue of the LISTEN port has been filled
the kernel will close these ports
(i don't think so that it's a netstat bug)
I'll be glad to anyone that will explain me more about it :-)
plz.. sorry for my english (i'm sure i have done too many mistakes :-) )
and also for all the lame thing said by me
ciao
alfonso
>
> Sherine
"Software is like sex; it's better when it's free" - Linus Torvalds -
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]