Solved

How to spawn a non-child process?

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
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 get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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.

816 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now