LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Kill in script not killing all processes (HPUX) (https://www.linuxquestions.org/questions/linux-general-1/kill-in-script-not-killing-all-processes-hpux-4175532477/)

SmurfGGM 01-30-2015 03:51 AM

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

pan64 01-30-2015 04:30 AM

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).


All times are GMT -5. The time now is 09:35 PM.