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
Now before processB dies, it should grep and print the PID of process A.
Can you please help me out.
Thanks
Last edited by vgersh99; 08-26-2009 at 12:55 PM..
Reason: code tags, PLEASE!
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
... (0 Replies)
Hi Friends,
I am new to this forum as well as new to shell scripting.
I have a problem here and i need someone to solve this.
Let us consider there are two processes(abc & def).There is a script which kills these two processes(i.e killtheprocess abc). Here abc is the argument .
There is a... (1 Reply)
Hi,
First, I am running a scipt.While the script is running I realize that I dont want the script to be run so I am killing the script externally.Before the process gets terminated or killed it should delete all the temporary files created by the script.How to do this?Can anyone help me?
... (3 Replies)
Hi,
I need to get the pid of a process and have to store the pid in a variable and i want to use this value(pid) of the variable for some process. Please can anyone tell me how to get the pid of a process and store it in a variable. please help me on this.
Thanks in advance,
Amudha (7 Replies)
Hi All,
Am copying mulitple files in a directory in names File0,File1,File2 etc.
I need to print separately the PID of these copies using File names.
for((i=0;i<5;i++))
do
mypid=`ps aux | awk '/File$i/ && !/awk/ { print $2 }'`
echo PID is $mypid
done
It printed nothing. Thinking... (6 Replies)
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)
hi, iam completely new to scripting. this may sound naive but i have spend lot of time figuring this out.
i want to make a script to find number of sql processes running. If the number of processes are more then 200, then pick out process IDs along with query it is executing, which are running... (0 Replies)
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
LEARN ABOUT MOJAVE
kill.d
kill.d(1m) USER COMMANDS kill.d(1m)NAME
kill.d - snoop process signals as they occur. Uses DTrace.
SYNOPSIS
kill.d
DESCRIPTION
kill.d is a simple DTrace program to print details of process signals as they are sent, such as the PID source and destination, signal num-
ber and result.
This program can be used to determine which process is sending signals to which other process.
Since this uses DTrace, only users with root privileges can run this command.
EXAMPLES
Default output, print process signals as they are sent.
# kill.d
FIELDS
FROM source PID
COMMAND
source command name
TO destination PID
SIG destination signal ("9" for a kill -9)
RESULT result of signal (-1 is for failure)
DOCUMENTATION
See the DTraceToolkit for further documentation under the Docs directory. The DTraceToolkit docs may include full worked examples with ver-
bose descriptions explaining the output.
EXIT
kill.d will run forever until Ctrl-C is hit.
AUTHOR
Brendan Gregg [Sydney, Australia]
SEE ALSO dtrace(1M), truss(1)version 0.90 May 14, 2005 kill.d(1m)