LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-10-2007, 10:56 AM   #1
2007fld
Member
 
Registered: Mar 2007
Distribution: FD4,6
Posts: 52

Rep: Reputation: 15
can't stop a process using pkill


I have a process running constanly:
Quote:
ps -ef | grep username1
username1 17704 1 0 08:29:34 pts/5 0:00 /usr/bin/perl /u00/usr/bin/load_balancer/perl_responder.pl
I can find the process using pgrep:
Quote:
bash-2.05$ pgrep -l perl_responder
17704 perl_responder.
But I can NOT stop the process using pkill:
Quote:
bash-2.05$ pkill -x perl_responder
bash-2.05$
And the prcess is still running.

Please help!! Thanks!
 
Old 09-10-2007, 01:25 PM   #2
bsdunix
Senior Member
 
Registered: May 2006
Distribution: BeOS, BSD, Caldera, CTOS, Debian, LFS, Mac, Mandrake, Red Hat, Slackware, Solaris, SuSE
Posts: 1,761

Rep: Reputation: 80
Maybe it has a parent process you need to kill?

http://en.wikipedia.org/wiki/Pstree
 
Old 09-11-2007, 08:18 AM   #3
sleepyEDB
Member
 
Registered: Dec 2005
Location: /USA/MI/Detroit/home
Distribution: MEPIS, antiX, RHEL
Posts: 105

Rep: Reputation: 15
Lightbulb

How about trying the kill command and the process ID?

Code:
kill -9 17704
sleepy
 
Old 09-12-2007, 08:01 AM   #4
2007fld
Member
 
Registered: Mar 2007
Distribution: FD4,6
Posts: 52

Original Poster
Rep: Reputation: 15
PID varies every time when the perl scripts gets executed.

I used pkill -f perl_responder, and it works.
 
Old 09-12-2007, 08:13 AM   #5
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by 2007fld
I used pkill -f perl_responder, and it works.
That's the way to do it. (Using the full argument list in the process table.)

For future reference, you can troubleshoot this using pgrep to make sure it's matching a PID.

edit: I need to learn to read early in the morning. To elaborate on that, use -f with pgrep as well.

Last edited by anomie; 09-12-2007 at 08:17 AM.
 
  


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
when a process cann't be terminated through kill/skill/pkill/killall... Osirix Linux - Software 9 07-18-2006 11:16 PM
How to know which process can be stop jojojo Linux - Newbie 3 06-15-2006 11:40 PM
how to stop a process? frostmagic Programming 14 12-05-2003 11:02 AM
How to stop LP process at bootup? britishnemesis Linux - Software 1 10-27-2003 01:04 AM
rc.d with K to stop the process... psyklops Linux - General 1 10-18-2003 01:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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