- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Process.destroy kills outer shell when killing inn...
Operating System - Linux
1748073
Members
5251
Online
108758
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-29-2004 05:56 AM
тАО10-29-2004 05:56 AM
Process.destroy kills outer shell when killing inner
Hi
I have a nice little problem when I use the Runtime.exec() method. If I have a running C++ binary in a Process object and I want to kill it I issue a destroy at the Process object and the process picks up whatever signals are sent and it it terminates correctly.
If I then use the same code to execute a shell script then the whole program terminates after picking up the sent signal.
The script I am using is a csh script:
#!/bin/csh -f
while (1)
echo help
sleep 10
done
# this will not terminate until I need it to
I am running this on Red Hat Linux and starting the process from a csh .. I have no idea why this is so .. has anyone else come across this before?
When I run this with verbose I also get the following before it all terminates (the log4j comment is just from a shutdownhook):
...
[Loaded sun.misc.Signal$1 from /sbcimp/run/tp/sun/jre/v1.4.2_04/lib/rt.jar]
Shutting down log4j processses
[Loaded java.util.Vector$1 from /sbcimp/run/tp/sun/jre/v1.4.2_04/lib/rt.jar]
[Loaded org.apache.log4j.helpers.NullEnumeration]
suggitpe./home/suggitpe/test/MEMPHIS/TAX_TEST/bin.xldn1081dap -->
I have a nice little problem when I use the Runtime.exec() method. If I have a running C++ binary in a Process object and I want to kill it I issue a destroy at the Process object and the process picks up whatever signals are sent and it it terminates correctly.
If I then use the same code to execute a shell script then the whole program terminates after picking up the sent signal.
The script I am using is a csh script:
#!/bin/csh -f
while (1)
echo help
sleep 10
done
# this will not terminate until I need it to
I am running this on Red Hat Linux and starting the process from a csh .. I have no idea why this is so .. has anyone else come across this before?
When I run this with verbose I also get the following before it all terminates (the log4j comment is just from a shutdownhook):
...
[Loaded sun.misc.Signal$1 from /sbcimp/run/tp/sun/jre/v1.4.2_04/lib/rt.jar]
Shutting down log4j processses
[Loaded java.util.Vector$1 from /sbcimp/run/tp/sun/jre/v1.4.2_04/lib/rt.jar]
[Loaded org.apache.log4j.helpers.NullEnumeration]
suggitpe./home/suggitpe/test/MEMPHIS/TAX_TEST/bin.xldn1081dap -->
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-31-2004 07:41 AM
тАО10-31-2004 07:41 AM
Re: Process.destroy kills outer shell when killing inner
Hi Peter,
Got some time to write some test programs. I could not reproduce yours error. The program works just fine. I used yours code for the script (replacing done with end!). I have tested on RedHat 9 and yours same version of Java (1.4.2_04-b05).
Bojan
Got some time to write some test programs. I could not reproduce yours error. The program works just fine. I used yours code for the script (replacing done with end!). I have tested on RedHat 9 and yours same version of Java (1.4.2_04-b05).
Bojan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-31-2004 08:17 AM
тАО10-31-2004 08:17 AM
Re: Process.destroy kills outer shell when killing inner
Sorry,
After reading yours post in thread
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=717270
I see that you was trying in ksh. Now I can replicate your simptom. The simptom is only when the subprocess is in ksh, I try bash and csh and works OK.
So, for me, ksh must be investigated.
Bojan
After reading yours post in thread
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=717270
I see that you was trying in ksh. Now I can replicate your simptom. The simptom is only when the subprocess is in ksh, I try bash and csh and works OK.
So, for me, ksh must be investigated.
Bojan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-01-2004 12:40 AM
тАО11-01-2004 12:40 AM
Re: Process.destroy kills outer shell when killing inner
Hi
I see what you mean. I have just written a test haness to test this (in isolation) and it would appear that the issue revolves around the linux implementation of KSH.
I have run the same test on solaris and using ksh is OK, if I then try it on Linux it kills the parent processes.
One other thing to note is that when I run on Solaris the parent PID is the java process, when I run in Linux the parent PID is a non-existent process.
I see what you mean. I have just written a test haness to test this (in isolation) and it would appear that the issue revolves around the linux implementation of KSH.
I have run the same test on solaris and using ksh is OK, if I then try it on Linux it kills the parent processes.
One other thing to note is that when I run on Solaris the parent PID is the java process, when I run in Linux the parent PID is a non-existent process.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP