Why does my job keep getting terminated in this case?
Why does my job keep getting terminated in this case?
am 09.09.2007 02:31:00 von grocery_stocker
-bash-3.2$ shopt huponexit
huponexit off
-bash-3.2$ find ./ -type f > /dev/null &
[1] 11612
-bash-3.2$ exit
logout
Connection closed by foreign host.
And after I log back in
-bash-3.2$ ps -p 11612
PID TT STAT TIME COMMAND
-bash-3.2$
I tried changing
find ./ -type f > /dev/null &
to
nohup find ./ -type f > /dev/null &
And still go the same thing. I even tried changing from bash to csh
and got the same thing. Ideas?
Chad
Re: Why does my job keep getting terminated in this case?
am 09.09.2007 02:39:38 von cfajohnson
On 2007-09-09, Chad wrote:
> -bash-3.2$ shopt huponexit
> huponexit off
>
> -bash-3.2$ find ./ -type f > /dev/null &
> [1] 11612
> -bash-3.2$ exit
> logout
> Connection closed by foreign host.
>
> And after I log back in
>
> -bash-3.2$ ps -p 11612
> PID TT STAT TIME COMMAND
> -bash-3.2$
>
> I tried changing
> find ./ -type f > /dev/null &
>
> to
>
> nohup find ./ -type f > /dev/null &
>
> And still go the same thing. I even tried changing from bash to csh
> and got the same thing. Ideas?
The job has finished by the time you log back in?
--
Chris F.A. Johnson, author
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
===== My code in this post, if any, assumes the POSIX locale
===== and is released under the GNU General Public Licence
Re: Why does my job keep getting terminated in this case?
am 09.09.2007 03:17:20 von grocery_stocker
On Sep 8, 5:39 pm, "Chris F.A. Johnson" wrote:
> On 2007-09-09, Chad wrote:
> > -bash-3.2$ shopt huponexit
> > huponexit off
>
> > -bash-3.2$ find ./ -type f > /dev/null &
> > [1] 11612
> > -bash-3.2$ exit
> > logout
> > Connection closed by foreign host.
>
> > And after I log back in
>
> > -bash-3.2$ ps -p 11612
> > PID TT STAT TIME COMMAND
> > -bash-3.2$
>
> > I tried changing
> > find ./ -type f > /dev/null &
>
> > to
>
> > nohup find ./ -type f > /dev/null &
>
> > And still go the same thing. I even tried changing from bash to csh
> > and got the same thing. Ideas?
>
> The job has finished by the time you log back in?
>
> --
> Chris F.A. Johnson, author
> Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
> ===== My code in this post, if any, assumes the POSIX locale
> ===== and is released under the GNU General Public Licence
I would like to believe that the job is still running after I logged
out.
Re: Why does my job keep getting terminated in this case?
am 09.09.2007 03:48:44 von cfajohnson
On 2007-09-09, Chad wrote:
> On Sep 8, 5:39 pm, "Chris F.A. Johnson" wrote:
>> On 2007-09-09, Chad wrote:
>> > -bash-3.2$ shopt huponexit
>> > huponexit off
>>
>> > -bash-3.2$ find ./ -type f > /dev/null &
>> > [1] 11612
>> > -bash-3.2$ exit
>> > logout
>> > Connection closed by foreign host.
>>
>> > And after I log back in
>>
>> > -bash-3.2$ ps -p 11612
>> > PID TT STAT TIME COMMAND
>> > -bash-3.2$
>>
>> > I tried changing
>> > find ./ -type f > /dev/null &
>>
>> > to
>>
>> > nohup find ./ -type f > /dev/null &
>>
>> > And still go the same thing. I even tried changing from bash to csh
>> > and got the same thing. Ideas?
>>
>> The job has finished by the time you log back in?
>
> I would like to believe
What does that have to do with anything?
> that the job is still running after I logged
> out.
That's more likely to happen if the command is:
nohup find / -type f > /dev/null &
Or run a script that has an infinite loop.
--
Chris F.A. Johnson, author
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
===== My code in this post, if any, assumes the POSIX locale
===== and is released under the GNU General Public Licence
Re: Why does my job keep getting terminated in this case?
am 09.09.2007 10:52:39 von Stephane CHAZELAS
2007-09-08, 17:31(-07), Chad:
> -bash-3.2$ shopt huponexit
> huponexit off
>
> -bash-3.2$ find ./ -type f > /dev/null &
> [1] 11612
> -bash-3.2$ exit
> logout
> Connection closed by foreign host.
>
> And after I log back in
>
> -bash-3.2$ ps -p 11612
> PID TT STAT TIME COMMAND
> -bash-3.2$
>
> I tried changing
> find ./ -type f > /dev/null &
>
> to
>
> nohup find ./ -type f > /dev/null &
>
> And still go the same thing. I even tried changing from bash to csh
> and got the same thing. Ideas?
[...]
If on Linux, try strace -o /tmp/strace.out find ... &
instead and look at /tmp/strace.out to check wether find got
kill or terminated for another reason (for example because it
couldn't write to its stderr).
--
Stéphane
Re: Why does my job keep getting terminated in this case?
am 09.09.2007 14:35:50 von Neil Cherry
On Sat, 08 Sep 2007 17:31:00 -0700, Chad wrote:
> -bash-3.2$ shopt huponexit
> huponexit off
>
> -bash-3.2$ find ./ -type f > /dev/null &
> [1] 11612
> -bash-3.2$ exit
> logout
> Connection closed by foreign host.
>
> And after I log back in
>
> -bash-3.2$ ps -p 11612
> PID TT STAT TIME COMMAND
> -bash-3.2$
I have no solution for the above but you might consider using
screen. Screen is a terminal multiplexor, think of it like a Window
manager for the command line. One of the benefits is that when you get
disconnected from a telnet, ssh or rlogin session your process doesn't
get disconnected. Screen also buffers the output so you can login
later and look at the output (as long as it doesn't over run the
screen buffer). I use it at work to run various tests that will take
more than a few hours (like 60+ hour tests :-). Screen has many other
features but I'll let you discover them on your own. Just doa search
on "screen tutorial" or "screen howto".
--
Linux Home Automation Neil Cherry ncherry@linuxha.com
http://www.linuxha.com/ Main site
http://linuxha.blogspot.com/ My HA Blog
Author of: Linux Smart Homes For Dummies