?
Solved

How to spawn a non-child process?

Posted on 2008-10-10
3
Medium Priority
?
1,125 Views
Last Modified: 2013-12-21
I have a ksh script that checks if a second script is running and if it isn't then it launches it using "&" at the end to make it resident.  (I'm not sure how to say it exactly...)

Is the process launched a "child" of the first script or is it considered a stand-alone process?  If it is still considered a child, then how can I rip it away from the parent?

BTW, I'm trying to avoid a <defunct> situation...
0
Comment
Question by:bganoush
3 Comments
 
LVL 19

Accepted Solution

by:
jools earned 2000 total points
ID: 22687104
perhaps use;

   nohup <script> &

0
 
LVL 40

Expert Comment

by:omarfarid
ID: 22687259
yes, nohup is the command to use since it detaches the process from the calling and process init (pid 1) becomes the parent process for it. You may check this with the ps -ef command and then looking for the ppid
0
 

Expert Comment

by:wburbidge
ID: 22709420
The & at the end allows the script to run in the background, the nohup command allows the current session to be exited and the program will continue running
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses
Course of the Month17 days, 2 hours left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question