Skip to ContentSkip to Footer
Start of content
- Community Home
- >
- Servers and Operating Systems
- >
- Operating System - Linux
- >
- General
- >
- Re: Process.destroy kills outer shell when killing...
General
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
-
- Forums
-
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
- HPE Blog, Austria, Germany & Switzerland
- Blog HPE, France
- HPE Blog, Italy
- HPE Blog, Japan
- HPE Blog, Middle East
- HPE Blog, Russia
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
-
Blogs
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Blog, Latin America
- HPE Blog, Middle East
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
-
Information
- Community
- Welcome
- Getting Started
- FAQ
- Ranking Overview
- Rules of Participation
- Tips and Tricks
- Resources
- Announcements
- Email us
- Feedback
- Information Libraries
- Integrated Systems
- Networking
- Servers
- Storage
- Other HPE Sites
- Support Center
- Aruba Airheads Community
- Enterprise.nxt
- HPE Dev Community
- Cloud28+ Community
- Marketplace
-
Forums
-
Blogs
-
Information
-
English
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
- Email to a Friend
- 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
- Email to a Friend
- 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
- Email to a Friend
- 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
- Email to a Friend
- 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.
End of content
United States
Hewlett Packard Enterprise International
Communities
- Communities
- HPE Blogs and Forum
© Copyright 2021 Hewlett Packard Enterprise Development LP