Solved

How to spawn a non-child process?

Posted on 2008-10-10
3
1,099 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 500 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Over the years I've spent many an hour playing on hardened, DMZ'd servers, with only a sub-set of the usual GNU toy's to keep me company; frequently I've needed to save and send log or data extracts from these server back to my PC, or to others, and…
Background Still having to process all these year-end "csv" files received from all these sources (including Government entities), sometimes we have the need to examine the contents due to data error, etc... As a "Unix" shop, our only readily …
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…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

792 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