Running a command in background?

jwantz at hpcc2.hpcc.noaa.gov jwantz at hpcc2.hpcc.noaa.gov
Tue Jun 18 19:56:27 EDT 2002


Hi Steve,
I'm not sure if anyone answered this one but a normal process would die. 
 However a daemon would not--it keeps on running independent of users.  
I know you do programming, you should get a good Linux or UNIX 
programming book and see just how easy it is to write daemons.  That's 
one of the coolest things about Linux.  What you do is start a parent 
process, fork a child process and then kill the parent.  By UNIX 
convention then inherents the process id of init pid of 1.  That's what 
makes it a daemon.

     Jim Wantz WB0TFK
On Tue, 18 Jun 2002, Steve Holmes wrote:

> I've seen the nohup mentioned various times and yet I do things like
> <command> & with no 'nohup' and I could logout without killing the job
> so wonder what the nohup is really doing there.  
> 
> Further thing, Teddy, if you want to be able  to followup and see the
> output of this job later on, you can do something like this; just
> substitute command with the command-line and options of your choosing.
> command >outfile 2>&1 &
> the >outfile redirects all output to the file, outfile and the 2>&1
> forces both stdout and stderr to be captured; the & forces the command
> into background as has been previously mentioned.
> 
> If you don't redirect the output this way, you will loos access to any
> output the command has to offer when you logout.
> 
> I've compiled my kernel this way numerous times; start this up, logout
> go away and log back in several hours later with output waiting for
> me.
> 
> I should also add that when output is being captured this way, you can
> also monitor this output later, if the job is still running, by 'tail
> -f outfile' The tail command lets you look at the file while it is
> still being written to.  Just hit the control-C key to break out of
> tail when you want to get out.
> 
> See 'man tail' for more info.
> 
> On Tue, Jun 18, 2002 at 07:10:51PM +1000, Shaun Oliver wrote:
> > Hi teddy,
> > Try using nohup command &
> > the nohup allows you to run a process without interuption. even when you
> > logout.
> > the & or ampusand, tells the second command to background itself after
> > execution.
> > so if you do that and then logout, it'll continue to run.
> > hth
> > 
> > 
> > -- 
> > Shaun Oliver
> > 
> > 
> > In a world whithout fences
> >           and walls who needs Windows and Gates?
> > 
> > EMAIL: shaun_oliver at optusnet.com.au
> > ICQ: 76958435
> > 
> > 
> > 
> > _______________________________________________
> > Speakup mailing list
> > Speakup at braille.uwo.ca
> > http://speech.braille.uwo.ca/mailman/listinfo/speakup
> 
> _______________________________________________
> Speakup mailing list
> Speakup at braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
> 





More information about the Speakup mailing list