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 - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-30-2015, 03:51 AM   #1
SmurfGGM
Member
 
Registered: Jul 2008
Posts: 49

Rep: Reputation: 0
Kill in script not killing all processes (HPUX)


Hi

I have a script running overnight to kill jboss process ..

Code:
for i in `ps -elfx|grep -i JBoss|grep -v grep|sed 's/[ ][ ]*/,/g'|cut -d',' -f4`
do
echo killing process $i
kill -9 $i
done
however, the script isn't killing off all the processes.

If I run the ps command, it is picking up all the processes correctly.

This seems to randomly happen.

I have tried running the script as the user of the procesess and as root, with the same random results.

Any idea's?

PS: This is on HPUX.

Thanks in advance
 
Old 01-30-2015, 04:30 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,930

Rep: Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321
yes, some processes cannot be killed (at all). It depends on the state of that process (or better to say what's happening currently in that process).
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Script for killing several processes and then launching them again dstu Linux - Newbie 5 01-10-2010 01:22 AM
killing child processes of a bash script results in strange random kills omnio Programming 6 03-12-2007 07:35 AM
script to kill processes tradnbillies Linux - Software 2 04-28-2006 03:00 PM
Shell-Script for killing processes oulevon Programming 4 02-14-2006 10:49 AM
Killing the sleeping script does not kill sleep Feyd-Rautha Linux - Newbie 4 12-07-2005 02:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:13 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
Open Source Consulting | Domain Registration