LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Pid of process changes constantly (https://www.linuxquestions.org/questions/linux-newbie-8/pid-of-process-changes-constantly-824966/)

konzo 08-08-2010 03:33 PM

Pid of process changes constantly
 
Hi all
I want to know what daemon listen on *: pop3. I use

Code:

netstat -a | grep pop3
tcp        0      0 *:pop3                  *:*                    LISTEN

then

Code:

kodeserver:/etc/init.d# ps aux | grep pop3
root      3919  0.0  0.0  3116  720 pts/0    S<+  22:33  0:00 grep pop3
kodeserver:/etc/init.d# ps aux | grep pop3
root      3921  0.0  0.0  3116  720 pts/0    S<+  22:33  0:00 grep pop3
kodeserver:/etc/init.d# ps aux | grep pop3
root      3923  0.0  0.0  3116  720 pts/0    R<+  22:33  0:00 grep pop3

but in every ps command, pid of the process increment with two.

How to see the pid of that daemon/process?

zootboy 08-08-2010 04:10 PM

When you do a ps aux | grep X, the last item in the list is always the grep command itself (since it is a process).

In your case, there are no processes with pop3 in the name, so the only thing your command returns is the grep process. That's also why it increments by two every time you run it. You've run two programs: 'ps' and 'grep'.

Anyway, it's likely that the program that's listening for pop3 connections does not have 'pop3' in its name. Check to see if you have any mail servers running. One of the most popular ones is 'postfix', but look for anything with the word 'mail' in it. That's likely your culprit.

konzo 08-08-2010 04:29 PM

I run all this scripts

Code:

kodeserver:/etc/init.d# /etc/init.d/postfix stop
Stopping Postfix Mail Transport Agent: postfix.
kodeserver:/etc/init.d# /etc/init.d/courier-authdaemon stop
Stopping Courier authentication services: authdaemond.
kodeserver:/etc/init.d# /etc/init.d/courier-imap stop
Stopping Courier IMAP server: imapd.
kodeserver:/etc/init.d# /etc/init.d/courier-imap-ssl stop
Stopping Courier IMAP-SSL server: imapd-ssl.
kodeserver:/etc/init.d# /etc/init.d/spamassassin stop
SpamAssassin Mail Filter Daemon: disabled, see /etc/default/spamassassin
kodeserver:/etc/init.d# /etc/init.d/saslauthd stop
Stopping SASL Authentication Daemon: saslauthd.
kodeserver:/etc/init.d# /etc/init.d/exim4 stop

and I restarted.
exim didn't give result maybe because I apt-get remove it. I can't remember what anything I have related with mail.

Is there some command that I can use to see what is listenting on pop3?

zootboy 08-08-2010 04:35 PM

Try this:

Code:

sudo netstat -a --program | grep pop3

konzo 08-08-2010 04:43 PM

It was inetd daemon. Thanks for the help.

zootboy 08-08-2010 04:48 PM

No problem.


All times are GMT -5. The time now is 03:02 AM.