The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to Kill a Process bennichan SUN Solaris 5 03-24-2008 02:14 AM
kill process ust UNIX for Advanced & Expert Users 1 11-27-2007 01:06 PM
kill(0,-9) don't kill the process umen High Level Programming 9 06-19-2007 07:09 AM
how to start a process and make it sleep for 5 mins and then kill that process shrao Shell Programming and Scripting 6 03-27-2007 01:54 PM
When kill doesnt work, how to kill a process ? VijayHegde UNIX for Advanced & Expert Users 3 05-12-2006 05:24 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 09-22-2006
rkrgarlapati rkrgarlapati is offline
Registered User
  
 

Join Date: Jul 2006
Posts: 31
Process KILL

Hi All,

i wrote a shell script in unix, which intern runs java code, which will process the text file for 2 minutes.

Senario : After 30 seconds of processing the file, sombody executed a command kill -9 <PID> which killed my process, i.e, my java code stop processing the file and my application got exit.

Issue : Now i am unable to know what happened to my application.
if someone kills my application, i want to log it into a log file saying <PID> GOT KILLED.

Can anybody help me with a piece of code, which i can put in the shell script after my java application starts, so that if my java application gets KILL, it can go into that condition:

Ex. : if (<PID> KILLED)
"<PID> GOT KILLED" > LOG.TXT

What can i put in the place of bold text in the above if statement.

Regards,
Ravi
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:48 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0