LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-08-2010, 02:33 PM   #1
konzo
Member
 
Registered: Dec 2008
Location: Bulgaria
Distribution: Debian / Slackware / Ubuntu
Posts: 230

Rep: Reputation: 33
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?

Last edited by konzo; 08-08-2010 at 02:35 PM.
 
Old 08-08-2010, 03:10 PM   #2
zootboy
Member
 
Registered: Nov 2008
Location: In a dumpster, with my laptop.
Distribution: Fedora
Posts: 124

Rep: Reputation: 25
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.
 
Old 08-08-2010, 03:29 PM   #3
konzo
Member
 
Registered: Dec 2008
Location: Bulgaria
Distribution: Debian / Slackware / Ubuntu
Posts: 230

Original Poster
Rep: Reputation: 33
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?
 
Old 08-08-2010, 03:35 PM   #4
zootboy
Member
 
Registered: Nov 2008
Location: In a dumpster, with my laptop.
Distribution: Fedora
Posts: 124

Rep: Reputation: 25
Try this:

Code:
sudo netstat -a --program | grep pop3
 
Old 08-08-2010, 03:43 PM   #5
konzo
Member
 
Registered: Dec 2008
Location: Bulgaria
Distribution: Debian / Slackware / Ubuntu
Posts: 230

Original Poster
Rep: Reputation: 33
It was inetd daemon. Thanks for the help.
 
Old 08-08-2010, 03:48 PM   #6
zootboy
Member
 
Registered: Nov 2008
Location: In a dumpster, with my laptop.
Distribution: Fedora
Posts: 124

Rep: Reputation: 25
No problem.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
pid of a process Marin_ Linux - Software 3 03-07-2010 10:22 PM
about pid of process hamedn Programming 2 01-27-2010 05:21 PM
how to get the name of process from PID in C/C++? kulandaivelu Programming 3 02-03-2009 09:41 AM
How to get the PID of the process giving kill signal to a process? hariprd Programming 2 11-27-2008 03:10 AM
[C++] Get process ID (PID) Moraxus Programming 5 10-16-2008 12:31 PM


All times are GMT -5. The time now is 02:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration