?
Solved

How to spawn a non-child process?

Posted on 2008-10-10
3
Medium Priority
?
1,119 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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 Month13 days, 23 hours left to enroll

801 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