Solved

How to spawn a non-child process?

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
Recently, an awarded photographer, Selina De Maeyer (http://www.selinademaeyer.com/), completed a photo shoot of a beautiful event (http://www.sintjacobantwerpen.be/verslag-en-fotoreportage-van-de-sacramentsprocessie-door-antwerpen#thumbnails) in An…
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…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

762 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

18 Experts available now in Live!

Get 1:1 Help Now