LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-27-2014, 04:53 AM   #16
robin444
LQ Newbie
 
Registered: Jan 2014
Posts: 13

Original Poster
Rep: Reputation: Disabled
Question


Quote:
Originally Posted by gengisdave View Post
hoping you use bash (don't know if it works with other shells) just create a script "killjava.sh" or whatever you want it called:

Code:
#!/bin/bash

kill -9 $PPID
you can put it in the same script directory and call it by "./killjava.sh", or put in any directory of $PATH, like /usr/local/bin and call it directly by "killjava.sh"; remember to 'chmod 755 killjava.sh' or you'll get "Permission denied"
you mean like this? JVM_ARGS="-Xms128m -Xmx128m -XX:OnOutOfMemoryError='./killjava.sh'
 
Old 01-27-2014, 04:55 AM   #17
gengisdave
Member
 
Registered: Dec 2013
Location: Turin, Italy
Distribution: slackware
Posts: 328

Rep: Reputation: 74
yes
 
Old 01-27-2014, 05:48 AM   #18
robin444
LQ Newbie
 
Registered: Jan 2014
Posts: 13

Original Poster
Rep: Reputation: Disabled
Question

Does kill -9 %p and kill -9 $PPID signify the same thing?
coz my service itself is getting killed by $PPID
 
Old 01-27-2014, 05:59 AM   #19
gengisdave
Member
 
Registered: Dec 2013
Location: Turin, Italy
Distribution: slackware
Posts: 328

Rep: Reputation: 74
it should; %p is the java command pid, and it is handled internally, while $PPID in bash scripting is the parent pid, the killing script is called directly by java in oom case, so $PPID is pid of java; you service kills $PPID which is the program who launch it
 
1 members found this post helpful.
Old 01-29-2014, 05:25 AM   #20
robin444
LQ Newbie
 
Registered: Jan 2014
Posts: 13

Original Poster
Rep: Reputation: Disabled
Talking

Quote:
Originally Posted by gengisdave View Post
it should; %p is the java command pid, and it is handled internally, while $PPID in bash scripting is the parent pid, the killing script is called directly by java in oom case, so $PPID is pid of java; you service kills $PPID which is the program who launch it
That definitely did the job!!!
Thank you so much!!
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there software to find network issue? Possible packets dropped or similar issue xmrkite Linux - Software 7 03-17-2015 06:33 PM
Joystick and USB issue, randomly connects, also caused a mouse issue. tim.sloane Linux - Hardware 1 08-08-2012 09:05 AM
Fedora 13 Installation issue -- Unable to install multiple linux distributions ---partition issue navneethr Linux - General 6 12-22-2010 11:17 PM
Postfix issue ; Must issue a STARTTLS command first after forcing TLS sarajevo Linux - Server 3 05-14-2009 08:28 AM
Trouble mounting ipod. Hal issue and mount point issue. okos Slackware 2 05-10-2009 11:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:07 AM.

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