Re: Make a program still run after logout



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.
.



Relevant Pages

  • Re: transaction logs filling up: detect offending job
    ... I had a problem with a copy that failed to terminate. ... The work round ... jruffer's Profile: http://community.actian.com/forum/member.php?userid=504 ...
    (comp.databases.ingres)
  • wmplayer.exe - Application Error
    ... memory could not be "read". ... Click on OK to terminate the program ... please help me in fixing this problem ... RamEEz's Profile: http://forums.techarena.in/member.php?userid=18119 ...
    (microsoft.public.windowsmedia.player)
  • Re: Multiple PrintDocuments in one job
    ... If you can redefine your project, ... to terminate adding pages. ... kramalheira's Profile: http://www.hightechtalks.com/m889 ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: Outlook 2003 User Accounts
    ... Processess for outlook.exe, if found terminate it ... outlook it asks to choose the profile and enter password. ...
    (microsoft.public.outlook.installation)