LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 01-11-2016, 11:44 PM   #1
grigory
Member
 
Registered: Oct 2015
Posts: 133

Rep: Reputation: Disabled
Ubuntu PID question


Hello!

I need some explanation as to why in Ubuntu the Process ID (PID) differs when it's being checked in different ways.
For example, crond. When I do this:
Quote:
sudo service cron status
I get:
Quote:
cron start/running, process 5610
But when I do that:
Quote:
ps aux | grep crond
I get:
Quote:
myusername 5647 0.0 0.0 17164 2412 pts/11 S+ 08:12 0:00 grep --color=auto crond
And when I run this command again and again I'm getting different PID each time (first 2 digits remain the same though, like 56xx).
Quote:
myusername 5658 0.0 0.0 17164 2400 pts/11 S+ 08:13 0:00 grep --color=auto crond
 
Old 01-11-2016, 11:51 PM   #2
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
The last two are not the PID of crond, they are the PIDs of your grep command...

Code:
myusername 5647 0.0 0.0 17164 2412 pts/11 S+ 08:12 0:00 grep --color=auto crond

myusername 5658 0.0 0.0 17164 2400 pts/11 S+ 08:13 0:00 grep --color=auto crond
 
1 members found this post helpful.
Old 01-12-2016, 04:44 AM   #3
grigory
Member
 
Registered: Oct 2015
Posts: 133

Original Poster
Rep: Reputation: Disabled
Thanks!

I ran this command this time:

Code:
ps aux | grep cron
And I got the same PID in both cases.
 
  


Reply



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
A question about our PID 1 friend, init... JMearsXS Linux - Software 9 09-17-2013 06:42 AM
A question about (no profile ) or (no pid file) thomas2004ch Linux - Software 1 03-02-2010 09:35 PM
BIND 9 question - PID Related ChardRF Red Hat 1 03-13-2005 02:15 PM
question about kill(pid, sig) THETEZ Programming 3 04-18-2004 05:37 AM
Question about PID BuccKevin Linux - General 2 11-10-2002 03:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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
Open Source Consulting | Domain Registration