LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-16-2014, 09:56 AM   #1
gosssamer
Member
 
Registered: Dec 2010
Posts: 59

Rep: Reputation: 0
pgrep fails to find results


Hi,

Hopefully a simple question. I'm using pgrep on fedora20 and having a problem. While it finds some processes, it doesn't find others and the man page doesn't describe how the pattern matching works very well.

Code:
# ps ax|grep amavisd
10263 ?        S      0:08 /usr/sbin/amavisd (ch9-avail)
13782 ?        S      0:05 /usr/sbin/amavisd (ch7-avail)
16663 ?        Ss   160:00 /usr/sbin/amavisd (master)
19410 pts/0    S+     0:00 grep --color=auto amavisd
28089 ?        Ssl  233:28 clamd.amavisd -c /etc/clamd.d/amavisd.conf --pid /var/run/clamd.amavisd/clamd.pid
# pgrep clamd.amavisd
# pgrep amavisd
# pgrep '/usr/sbin/amavisd (master)'
# pgrep 'clamd\.amavisd'
Any ideas would be greatly appreciated.

Thanks,
Alex
 
Old 05-16-2014, 10:19 AM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
Code:
$ ps -ef | grep amavisd-new
alucard  21024 20889  0 10:17 pts/3    00:00:00 grep amavisd-new
amavis   23767     1  0 May11 ?        00:00:04 /usr/sbin/amavisd-new (master)
amavis   23769 23767  0 May11 ?        00:00:12 /usr/sbin/amavisd-new (ch18-avail)
amavis   23770 23767  0 May11 ?        00:00:03 /usr/sbin/amavisd-new (ch17-avail)
$ pgrep -u amavis -l
23767 /usr/sbin/amavi
23769 /usr/sbin/amavi
23770 /usr/sbin/amavi
$ pgrep /usr/sbin/amavi
23767
23769
23770
$ pgrep -f amavis
23767
23769
23770
Looks like the name is limited to 15 characters (??). Use -f to match the whole command line.
(I read the man page to get the idea to try -l and -f)
 
1 members found this post helpful.
Old 05-16-2014, 11:45 AM   #3
gosssamer
Member
 
Registered: Dec 2010
Posts: 59

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by AlucardZero View Post
Code:
$ ps -ef | grep amavisd-new
alucard  21024 20889  0 10:17 pts/3    00:00:00 grep amavisd-new
amavis   23767     1  0 May11 ?        00:00:04 /usr/sbin/amavisd-new (master)
amavis   23769 23767  0 May11 ?        00:00:12 /usr/sbin/amavisd-new (ch18-avail)
amavis   23770 23767  0 May11 ?        00:00:03 /usr/sbin/amavisd-new (ch17-avail)
$ pgrep -u amavis -l
23767 /usr/sbin/amavi
23769 /usr/sbin/amavi
23770 /usr/sbin/amavi
$ pgrep /usr/sbin/amavi
23767
23769
23770
$ pgrep -f amavis
23767
23769
23770
Looks like the name is limited to 15 characters (??). Use -f to match the whole command line.
(I read the man page to get the idea to try -l and -f)
Ah, thanks. There's a bug in the /usr/share/spamassassin/sa-update.cron script in fedora20. It fails to find amavisd using just "pgrep amavisd".
 
  


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
Can't find LQ survey results... JimMcCall Linux - Software 1 10-05-2012 11:46 AM
sha1sum check fails with different results - Fedora 8 - x86_64 janesfelcs Fedora - Installation 2 01-23-2008 09:05 AM
pgrep on windows os melinda_sayang General 1 02-16-2007 02:02 PM
bash find results bendeco13 Linux - General 6 10-26-2004 12:48 PM
pgrep/pkill d3funct Linux - General 0 09-18-2001 03:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:50 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