PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > comp.unix.shell > Why does my job keep getting terminated in this case?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.unix.shell Using and programming the Unix shell.

Why does my job keep getting terminated in this case?

Réponse
 
LinkBack Outils de la discussion
Vieux 09/09/2007, 01h31   #1
Chad
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Why does my job keep getting terminated in this case?

-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

  Réponse avec citation
Vieux 09/09/2007, 01h39   #2
Chris F.A. Johnson
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Why does my job keep getting terminated in this case?

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 <http://cfaj.freeshell.org/shell/>
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
  Réponse avec citation
Vieux 09/09/2007, 02h17   #3
Chad
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Why does my job keep getting terminated in this case?

On Sep 8, 5:39 pm, "Chris F.A. Johnson" <cfajohn...@gmail.com> 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 <http://cfaj.freeshell.org/shell/>
> 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.

  Réponse avec citation
Vieux 09/09/2007, 02h48   #4
Chris F.A. Johnson
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Why does my job keep getting terminated in this case?

On 2007-09-09, Chad wrote:
> On Sep 8, 5:39 pm, "Chris F.A. Johnson" <cfajohn...@gmail.com> 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 <http://cfaj.freeshell.org/shell/>
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
  Réponse avec citation
Vieux 09/09/2007, 09h52   #5
Stephane CHAZELAS
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Why does my job keep getting terminated in this case?

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
  Réponse avec citation
Vieux 09/09/2007, 13h35   #6
Neil Cherry
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Why does my job keep getting terminated in this case?

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
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 19h48.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,15283 seconds with 14 queries