Re: Make a program still run after logout
- From: John-Paul Stewart <jpstewart@xxxxxxxxxxxxxxxx>
- Date: Fri, 22 Dec 2006 13:46:43 -0500
lovecreatesbea...@xxxxxxxxx wrote:
At the point of executing the above command "nohup a.out",
a.out is not running, right?
Correct.
If a.out is already a running process, can
I bring it to the background when it runs in the foreground?
If it's in the foreground, you can stop it with CTRL+Z. Then Bash will print out a line with the job number (in square brackets) and some other info (including the program name). You can put the stopped job in the background with 'bg 2' (or whatever the job number printed was). That would be equivalent to running 'a.out &'. You can also use 'jobs' to check the job numbers of background tasks.
Note that background processes will terminate when you exit the shell unless you start them as 'nohup a.out &' -or- you set 'shopt -u huponexit' somewhere (either in your profile or on the command line) -or- you run 'disown -h 2' (or whatever the proper job number is).
By far the easiest thing to do is simply start the job with as 'nohup a.out &'. That will automatically redirect output to a log file instead of the terminal, too.
.
- References:
- Make a program still run after logout
- From: lovecreatesbea...@xxxxxxxxx
- Re: Make a program still run after logout
- From: General Schvantzkoph
- Re: Make a program still run after logout
- From: lovecreatesbea...@xxxxxxxxx
- Re: Make a program still run after logout
- From: Ron Hardin
- Re: Make a program still run after logout
- From: lovecreatesbea...@xxxxxxxxx
- Make a program still run after logout
- Prev by Date: Re: Make a program still run after logout
- Next by Date: Re: Make a program still run after logout
- Previous by thread: Re: Make a program still run after logout
- Next by thread: Re: Make a program still run after logout
- Index(es):
Relevant Pages
|