Bug 467622

Summary: nohup job is killed when ssh times out
Product: [Fedora] Fedora Reporter: Sammy <umar>
Component: coreutilsAssignee: Ondrej Vasik <ovasik>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 8CC: kdudka, ovasik, sergio, twaugh
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-01-09 06:48:04 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
dummy job none

Description Sammy 2008-10-19 15:27:27 UTC
This has been an ongoing issue for a while now. It involves the
following components: nohup, ssh, kernel, openmp.

When one starts a job remotely using nohup and normally logs out
(ctrl-D) the job stays running. However, if you do not logout and
let ssh time out the job is killed.

The situation is more interesting on a multi-processor machine when
running an openmp job. In this case it seems to kill all but one
of the threads and the job keeps running on a single cpu.

I am surprised this has not been reported earlier since I have been
aware of it for many months now.

If you feel that this is a problem with "ssh" please change the
ownership.
Thanks.

Comment 1 Kamil Dudka 2008-11-06 13:57:57 UTC
Created attachment 322714 [details]
dummy job

Is there any way to easy reproduce this behavior? My experiment:

In the 1st terminal:
$ ssh root@xen89
# tailf /var/log/secure &

In the 2nd terminal:
$ ssh xen89
$ nohup ./bigjob.sh # bigjob.sh is attached

In the 3rd terminal:
$ kill -s SIGSTOP 24366 # pid of ssh client in 2nd terminal

In the 1st terminal:
# ps -A | grep bigjob.sh >/dev/null && echo job is running
job is running

Nov  6 14:49:17 xen89 sshd[2175]: Timeout, client not responding.

# ps -A | grep bigjob.sh >/dev/null && echo job is running
job is running

Note that without nohup the job is killed after timeout. So in this example it seems to work for me. Could you please do this experiments on your machine?

Can you give in this way a simple example where this fails?

Comment 2 Sammy 2008-11-07 14:32:37 UTC
This only happens when I login from home into my office Desktop PC. Both
running Fedora 8+all updates and both x86_64. When I run locally ssh never
seems to time out.

$ssh compsci
$nohup big_job&


At this point if I do ctrl-D and logout job keeps running. If I do
nothing after a while session times out and connection is lost. If
you ssh back in job is killed.

NOTE: The big_job is an OpenMP job running on 4 processors. Could this
      make a diffference?

Comment 3 Kamil Dudka 2008-11-07 14:51:31 UTC
(In reply to comment #2)
> This only happens when I login from home into my office Desktop PC. Both
> running Fedora 8+all updates and both x86_64. When I run locally ssh never
> seems to time out.
Locally means ssh localhost? I am able to cause timeout even on localhost, try to set ClientAliveInterval in /etc/ssh/sshd_config to few seconds, (restart sshd), connect with ssh and then send SIGSTOP to ssh process.

> NOTE: The big_job is an OpenMP job running on 4 processors. Could this
>       make a difference?
Maybe. Could you send me the big_job binary? or its sources if license requires it :-) or just another program which helps me to reproduce this issue...

Comment 4 Bug Zapper 2008-11-26 11:14:50 UTC
This message is a reminder that Fedora 8 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 8.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '8'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 8's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 8 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 5 Bug Zapper 2009-01-09 06:48:04 UTC
Fedora 8 changed to end-of-life (EOL) status on 2009-01-07. Fedora 8 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 6 Sammy 2019-11-14 13:59:29 UTC
CLOSED

Comment 7 Sergio Basto 2020-10-19 09:17:43 UTC
https://unix.stackexchange.com/questions/420594/why-process-killed-with-nohup, solution [1] 

[1]
https://unix.stackexchange.com/a/420663/32478

$ systemd-run --scope --user [command]