Linux - SoftwareThis 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.
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.
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I written a C program that forks and execs a shell script. The shell script then invokes the JVM to execute a Java program. This all works ok.
My C program (the parent) gets the pid of the shell script (the child) as the return value from the fork call. When I try to kill the script and the jvm by sending the SIGTERM signal to the child process, the child process (the script) dies, but the JVM continues to run. I use kill(child_pid, SIGTERM) in my C code, where child_pid was returned to my by fork, as mentioned above.
When I do a ps from the command prompt, I can see the script and JVM processes. When I check the status of these processes in /proc, the JVM is indeed a child of the script process.
Is it because my script process does not propagate the SIGTERM signal to its child (the JVM)?
Do I need to do something more to my script to propagate this signal?
Here is my script (note cvm is the jvm on my system, I use J2ME, MyProg is my Java program):