how to put a program in backgroud and logout?

how to put a program in backgroud and logout?

Post by hou » Sun, 13 Apr 2003 13:04:12



Hi everyone
     I have testing some algorithms and the program is going to run at least
5 hours.  How can I put it in backgroud and logout?  I tried to issue the
command

%java myprogram > testdata1 &

But I can't not logout. My shell was waiting for the jobs done.
Thank you very much
Dean

 
 
 

how to put a program in backgroud and logout?

Post by Erik Max Franci » Sun, 13 Apr 2003 13:56:09



> %java myprogram > testdata1 &

> But I can't not logout. My shell was waiting for the jobs done.

man nohup

--

 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ When you talk to her / Talk to her
\__/ India Arie
    WebVal / http://www.alcyone.com/pyos/webval/
 URL scanner, maintainer, and validator in Python.

 
 
 

how to put a program in backgroud and logout?

Post by Barry Kimelma » Sun, 13 Apr 2003 22:02:18


[This followup was posted to comp.unix.questions]


says...

Quote:> Hi everyone
>      I have testing some algorithms and the program is going to run at least
> 5 hours.  How can I put it in backgroud and logout?  I tried to issue the
> command

> %java myprogram > testdata1 &

> But I can't not logout. My shell was waiting for the jobs done.
> Thank you very much
> Dean

nohup java myprogram > testdata1 2>&1 error.log &

--
---------

Barry Kimelman
Winnipeg, Manitoba, Canada

 
 
 

how to put a program in backgroud and logout?

Post by hou » Mon, 14 Apr 2003 05:06:54



> nohup java myprogram > testdata1 2>&1 error.log &
> --
> ---------
> Barry Kimelman
> Winnipeg, Manitoba, Canada


I have tried the example here.
My C-shell told me it is an ambigous expression.

and I also tried

nohup java myprogram >& testdata &

It is the same. It won't allow me to logout unless
I select "kill" from system menu to let the init process
to become the parent of my java process. It's weird... :-(

Dean

 
 
 

how to put a program in backgroud and logout?

Post by Majick Man » Mon, 14 Apr 2003 06:25:34



> Hi everyone
>      I have testing some algorithms and the program is going to run at least
> 5 hours.  How can I put it in backgroud and logout?  I tried to issue the
> command

> %java myprogram > testdata1 &

> But I can't not logout. My shell was waiting for the jobs done.
> Thank you very much
> Dean

I would use "at".  See man at... HTH  --majickmann
 
 
 

how to put a program in backgroud and logout?

Post by Chuck Dillo » Tue, 15 Apr 2003 22:55:03




>>nohup java myprogram > testdata1 2>&1 error.log &

>>--
>>---------

>>Barry Kimelman
>>Winnipeg, Manitoba, Canada

> I have tried the example here.
> My C-shell told me it is an ambigous expression.

> and I also tried

> nohup java myprogram >& testdata &

> It is the same. It won't allow me to logout unless
> I select "kill" from system menu to let the init process
> to become the parent of my java process. It's weird... :-(

> Dean

Nohup is a built in command for csh and in theory all commands put in
the background are effectively nohupped in csh.

Does the shell complain of stopped jobs?  That's the only reason I can
think of that the csh itself would refuse to exit/logout because of
existing jobs.  What does the 'jobs' command show before you logout?

If you are actually exiting with logout what does your .logout file
contain?  Is it perhaps doing a wait?

You might also try redirecting stdin when you run the java program
(i.e. </dev/null).

As someone else suggested. You can always run it via at.  Then you
don't need to redirect the output, at will email it to you.

-- ced

--
Chuck Dillon
Senior Software Engineer
NimbleGen Systems Inc.

 
 
 

how to put a program in backgroud and logout?

Post by hou » Sun, 20 Apr 2003 01:59:02




>> I have tried the example here.
>> My C-shell told me it is an ambigous expression.

>> and I also tried

>> nohup java myprogram >& testdata &

>> It is the same. It won't allow me to logout unless
>> I select "kill" from system menu to let the init process
>> to become the parent of my java process. It's weird... :-(

>> Dean
> Nohup is a built in command for csh and in theory all commands put in
> the background are effectively nohupped in csh.
> Does the shell complain of stopped jobs?  That's the only reason I can
> think of that the csh itself would refuse to exit/logout because of
> existing jobs.  What does the 'jobs' command show before you logout?
> If you are actually exiting with logout what does your .logout file
> contain?  Is it perhaps doing a wait?
> You might also try redirecting stdin when you run the java program
> (i.e. </dev/null).
> As someone else suggested. You can always run it via at.  Then you
> don't need to redirect the output, at will email it to you.
> -- ced
> --
> Chuck Dillon
> Senior Software Engineer
> NimbleGen Systems Inc.

I think I misunderstood the concept of login shell and xterm.
Actually, I am still comfused...
I am using ctwm as my window manager.  The setting is we have a
console window and I can logout from that window without any problem.
The actually problem is I can not logout from one of my xterm window,
where I issued

%java myprog >& testdata &
%logout

That xterm just sits there waiting the backgroud jobs to terminate and
then it will exit.  But I have no problem to logout through my console
window.  By the way, I create my xterm via

%xterm -bg black -fg white -e ssh -1 -l dhou rohan &

Does it cause any problem??
Thank you very much
Dean ( still confused ) :-(

 
 
 

how to put a program in backgroud and logout?

Post by those who know me have no need of my nam » Mon, 21 Apr 2003 03:44:16


in comp.unix.questions i read:

Quote:>%java myprog >& testdata &
>%logout

>That xterm just sits there waiting the backgroud jobs to terminate and
>then it will exit.

the reason being that stdin is still connecting the program to the xterm.
use:

  nohup java myprog </dev/null >& testdata &
  logout

--
bringing you boring signatures for 17 years

 
 
 

1. HELLO . HOW TO PERFORM BACKGROUD PROGRAM EXECUTION ?

i would like to performa background execution program to check
constantly , who is login in . If the person , is in my file for look
up , a meesage will appear saying the person is log on .

This must be executed in the back ground  , because i will be doing
other things then . Please tell me how . Please email to me directly .

thank you

2. KDE2 transparency & XFree86 3.3.6

3. put a running program in background in the program itself

4. TV/video capture cards are great. But which one ?

5. Matrox Mystique ands X.

6. Allow all users to mount to a usb flash drive

7. logout without executing .logout

8. SB-16 IDE CDrom support for kernal

9. Help! .logout not executed on logout!

10. Force logout after program termination

11. How to : Program still running after user logout

12. in ftp, put put *`date '+%Y%m%d'` doesn't work

13. preventing program exit on logout under X