On Tue, 2003-07-01 at 05:24, Pierre Fortin wrote:
> On 30 Jun 2003 09:32:01 -0700 James Sparenberg <[EMAIL PROTECTED]>
> wrote:
> 
> > On Mon, 2003-06-30 at 07:01, Pierre Fortin wrote:
> > > On Mon, 30 Jun 2003 05:51:48 -0700 (PDT) "David Guntner"
> > > <[EMAIL PROTECTED]> wrote:
> > > 
> > > > James Sparenberg grabbed a keyboard and wrote:
> > > > >
> > > > > No this is not spam for a talk show.  :)  I'm trying to find out
> > > > > how to spawn a process from a shell script that becomes an
> > > > > independent Parent process not a child process.  Such so that if
> > > > > the Parent that spawns it dies it doesn't die.  What I need is to
> > > > > have the parent process spawn the new process, then complete
> > > > > itself and die.  While the child becomes independent and continues
> > > > > it's life until it completes it's actions.
> > > > 
> > > > man nohup.
> > > > 
> > > >         --Dave
> > > 
> > > also: man bash, see disown 
> > 
> > 
> > Still not getting the results I need .... The parent remains open in a
> > wait state for the child to complete.  I can kill the parent without
> > affecting the child.. but the parent will not exit until the child
> > does.. I'm getting closer.  Basically this is going into an rpm which is
> > part of a group of rpms.  This one product that has to get installed
> > ahead of a number of others (dependencies) has a long self install
> > program that runs.  There is no reason it can't run in the background
> > while the other rpms get installed.  Doing this would cut totally
> > install of the "group" by about 50% is why I'm trying to to this. 
> > Thanks again for the answers....
> > 
> > James
> > 
> > 
> > I'm experimenting ... If I find it all let ya'll know
> 
> James,
> 
> Haven't checked for the parent sticking around; but I used to start a task
> in background and then disown the job and disconnect from the remote
> host...  let us know if that parent still hangs around in that scenario...
> 
if I do it as two bash shell scripts one called parent one called
child.  

#PARENT
!/bin/sh
nohup xterm -e ./child &
exit 0

#CHILD
#!/bin/sh
echo 1
sleep 2
echo 2
sleep 2
echo 3
sleep 2
echo 4
sleep 2
echo 5


It works as expected.. the parent automatically dies and the child
continues it's run... Problem is when I put a similar case into an RPM
and it runs it.  It hangs.  RPM will not continue until child runs it's
course.  And all the time that rpm #1 is open I can't start installing
rpm #2 (the rpm database does not multi-task.)  grrrr.  Although rpm
uses bash shell scripts it sure doesn't use them correctly.

James
  


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to