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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
01-27-2014, 04:53 AM
|
#16
|
LQ Newbie
Registered: Jan 2014
Posts: 13
Original Poster
Rep: 
|
Quote:
Originally Posted by gengisdave
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'
|
|
|
01-27-2014, 04:55 AM
|
#17
|
Member
Registered: Dec 2013
Location: Turin, Italy
Distribution: slackware
Posts: 328
Rep:
|
yes
|
|
|
01-27-2014, 05:48 AM
|
#18
|
LQ Newbie
Registered: Jan 2014
Posts: 13
Original Poster
Rep: 
|
Does kill -9 %p and kill -9 $PPID signify the same thing?
coz my service itself is getting killed by $PPID
|
|
|
01-27-2014, 05:59 AM
|
#19
|
Member
Registered: Dec 2013
Location: Turin, Italy
Distribution: slackware
Posts: 328
Rep:
|
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.
|
01-29-2014, 05:25 AM
|
#20
|
LQ Newbie
Registered: Jan 2014
Posts: 13
Original Poster
Rep: 
|
Quote:
Originally Posted by gengisdave
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!! 
|
|
|
All times are GMT -5. The time now is 07:27 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|