killing PID's of ptree


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting killing PID's of ptree
# 1  
Old 06-20-2006
MySQL killing PID's of ptree

gurus,

normally to stop a process ,i need to kill all its child & then parent process.
i do it manually as follows

bash-2.03$ ps -ef | grep bpm|grep -v grep
tibadmin 21882 21875 0 May 27 ? 0:00 /bin/sh ./bpmse_20.sh -Xms512m -Xmx512m /tibco/UpdateCustomer/dat/UpdateCustome

tibadmin 9067 9061 0 Jun 05 ? 0:00 /bin/sh ./bpmse_20.sh /tibco/Wireline/OM/dat/OMWIrelineBPM -p /tibco/Wireline/O


bash-2.03$ ptree 9061
9061 /bin/sh /tibco/Wireline/OM/scripts/startWirelineOM.sh
9067 /bin/sh ./bpmse_20.sh /tibco/Wireline/OM/dat/OMWIrelineBPM -p /tibco/Wireline/O
9075 /usr/j2se/jre/bin/../bin/sparc/native_threads/java -server -Xms1024m -Xmx1024m

bash-2.03$ kill -9 9061 9067 9075

there are two more things to be done apart from this...

what i want is to put all these tasks in a shell script
last 2 tasks i can put in a shell script...but how can i kill PID's from 'ptree' output due to their irregular display.....i need to grep these PID's & kill them...

ANY suggestions on this?



my second query is like these :

i have 100 files & each of these files contain a specific word in them...
i need to search this word in all these files ,how can i do it?


thanks & regards
abhijeet
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Trap killing PID

Hi, Just wonder if there is a way to identify the PID of the killing process using trap. Please let me know possible solution. #!/bin/ksh hello () { print "in hello"; print "PID of process issued SIGNAL"; --> this is what i'm looking for. } trap hello SIGKILL SIGTERM while... (3 Replies)
Discussion started by: Gajendra_PH
3 Replies

2. UNIX for Dummies Questions & Answers

Need script for killing Pid in Linux

need script(shell or python) for killing pid in linux (2 Replies)
Discussion started by: roshan9995
2 Replies

3. Shell Programming and Scripting

Finding the age of a unix process, killing old processes, killing zombie processes

I had issues with processes locking up. This script checks for processes and kills them if they are older than a certain time. Its uses some functions you'll need to define or remove, like slog() which I use for logging, and is_running() which checks if this script is already running so you can... (0 Replies)
Discussion started by: sukerman
0 Replies

4. Shell Programming and Scripting

prstat from ptree ...

Hi, I know how to figure out the list of PID from my application name : ptree `pgrep MyApp` | awk '{print $1}' But I dont know how to pipe it for prstat -p <pidlist> ptree `pgrep MyApp` | awk '{print $1}' | prstat -p ??? I would like to monitor every ptree PID from my application. ... (4 Replies)
Discussion started by: RickTrader
4 Replies

5. Solaris

Finding PID of Killing process

Say I have 2 processes(perl scripts on Solaris machine) A and B. the process A kill the process B. While in the process B how do I print the PID of the process that Killed it(process A) before dieing. My process A looks like open(STATS, "ps -ef|"); while ($inputLine = <STATS>) { if... (7 Replies)
Discussion started by: enigma_007
7 Replies

6. Red Hat

pfiles and pstack and ptree

Can someone tell me the Linux equivalent for pstack and pfiles and ptree which are Solaris commands. (1 Reply)
Discussion started by: bdsffl
1 Replies

7. Gentoo

ptree for linux

at work, I'm a UNIX administrator, but at home I use openSUSE 11. One of the commands that I use to assist me in trouble shooting A LOT is called ptree process tree. does anyone know of a ptree for linux? yes, I can just use ps -ef and see who the parent pid is and then 'ps -ef | grep <parent... (4 Replies)
Discussion started by: james.witte
4 Replies

8. UNIX for Advanced & Expert Users

killing a process pid

What option is used with kill to cause the server to reread its config file. (16 Replies)
Discussion started by: jo calamine
16 Replies

9. UNIX for Dummies Questions & Answers

Session PID & socket connection pid

1. If I use an software application(which connects to the database in the server) in my local pc, how many PID should be registered? Would there be PID for the session and another PID for socket connection? 2. I noticed (through netstat) that when I logged in using the my software application,... (1 Reply)
Discussion started by: pcx26
1 Replies

10. Shell Programming and Scripting

Meaning of ps -afe ,ps -fp and ptree

Hello, I was searching for the meaning of commands like ps -afe ,ps -fp and ptree but was not able to find there exact meaning .... Pls help me in getting these... Thanks in advance, Pradeep (1 Reply)
Discussion started by: PradeepRed
1 Replies
Login or Register to Ask a Question