<div dir="ltr">Many years ago I was looking into this and found out that the problem was that the whole process group was getting killed, as a feature. So to get the process to persist when the ssh session went away, I had to dissociate the process of interest from its process group.<div><br></div><div>The most straightforward way to do it using only the shell was to force the process to get owned by init by creating a sub-shell (to serve as a temporary parent) that immediately exited, e.g., the parentheses syntax creates a subshell that exits as soon as the sleep starts in the background.</div><div><br></div><div>(/bin/sleep 100 < /dev/null > /dev/null 2>&1 &)</div><div><br></div><div>Yes, screen or tmux or daemonizing does it, too.</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jul 31, 2019 at 11:01 AM Lightner, Jeffrey via Ale <<a href="mailto:ale@ale.org">ale@ale.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div lang="EN-US">
<div class="gmail-m_4408988844327765073WordSection1">
<p class="gmail-m_4408988844327765073MsoPlainText">I gather you're doing an ssh from one system to another. I wonder if your shell default on either the system you're coming from or the second system has TMOUT variable set and it is thinking the session is idle due to lack of output.
If so, doing an unset TMOUT might solve it. Note I have seen issues where firewall devices will timeout sessions such as VPN but I can full them by running a while loop in another window to just display data to the screen every 5 minutes.<br>
<br>
As posted by someone else I typically run:<br>
nohup <script> &<br>
<br>
The nohup tells it not to send a hang-up (hup) when the terminal closes. The & tells it to background.
<br>
This runs well for me when I run it from an internal Linux workstation to a Linux server in our remote data center. There is no firewall in between so other than insuring TMOUT isn't set I've not needed to do anything to leave jobs running overnight.<br>
<br>
If all that doesn't work, then screen is the way to go. It isn’t that hard to use or train others to use.<u></u><u></u></p>
<p class="gmail-m_4408988844327765073MsoPlainText"><br>
P.S. Retiring after leaving someone with the soon to be EOLed RHEL6 (Or CentOS6) on a new install is a dirty trick IMHO :p<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0in 0in">
<p class="MsoNormal"><b>From:</b> Ale <<a href="mailto:ale-bounces@ale.org" target="_blank">ale-bounces@ale.org</a>> <b>On Behalf Of </b>Chris Fowler via Ale<br>
<b>Sent:</b> Wednesday, July 31, 2019 10:52 AM<br>
<b>To:</b> <a href="mailto:neal@mnopltd.com" target="_blank">neal@mnopltd.com</a><br>
<b>Cc:</b> Atlanta Linux Enthusiasts <<a href="mailto:ale@ale.org" target="_blank">ale@ale.org</a>><br>
<b>Subject:</b> Re: [ale] After 15 years, Nohup is sttll broken???<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:12pt;font-family:Arial,sans-serif;color:black"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12pt;font-family:Arial,sans-serif;color:black"><u></u> <u></u></span></p>
</div>
<div class="MsoNormal" align="center" style="text-align:center"><span style="font-size:12pt;font-family:Arial,sans-serif;color:black">
<hr size="3" width="100%" align="center" id="gmail-m_4408988844327765073zwchr">
</span></div>
<div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1.5pt solid rgb(16,16,255);padding:0in 0in 0in 4pt;margin-left:3.75pt;margin-top:5pt;margin-bottom:5pt">
<p class="MsoNormal"><b><span style="font-size:12pt;font-family:Helvetica,sans-serif;color:black">From:
</span></b><span style="font-size:12pt;font-family:Helvetica,sans-serif;color:black"><a href="mailto:neal@mnopltd.com" target="_blank">neal@mnopltd.com</a><br>
<b>To: </b>"Chris Fowler" <<a href="mailto:cfowler@outpostsentinel.com" target="_blank">cfowler@outpostsentinel.com</a>><br>
<b>Cc: </b>"Atlanta Linux Enthusiasts" <<a href="mailto:ale@ale.org" target="_blank">ale@ale.org</a>><br>
<b>Sent: </b>Wednesday, July 31, 2019 10:45:20 AM<br>
<b>Subject: </b>Re: [ale] After 15 years, Nohup is sttll broken???<u></u><u></u></span></p>
</blockquote>
</div>
<div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1.5pt solid rgb(16,16,255);padding:0in 0in 0in 4pt;margin-left:3.75pt;margin-top:5pt;margin-bottom:5pt">
<p class="MsoNormal" style="margin-bottom:12pt"><span style="font-size:12pt;font-family:Helvetica,sans-serif;color:black">Thank you for the reply. Additional response inline below.<br>
<br>
On 2019-07-31 09:19, Chris Fowler wrote:<br>
> -------------------------<br>
> <br>
>> FROM: "Neal Rhodes via Ale" <<a href="mailto:ale@ale.org" target="_blank">ale@ale.org</a>><br>
>> TO: "Jim Kinney" <<a href="mailto:jim.kinney@gmail.com" target="_blank">jim.kinney@gmail.com</a>><br>
>> CC: "Atlanta Linux Enthusiasts" <<a href="mailto:ale@ale.org" target="_blank">ale@ale.org</a>><br>
>> SENT: Wednesday, July 31, 2019 10:10:41 AM<br>
>> SUBJECT: Re: [ale] After 15 years, Nohup is sttll broken???<br>
> <br>
>> Well, indirectly - if the ssh session didn't die, it probably<br>
>> wouldn't<br>
>> happen.<br>
> I've been using keepalive SSH options for years to keep session up.<br>
> I had system that did dialout ppp to servers with an idle timeout set<br>
> for pppd. SSH session would drop so I used the keep alive out of band<br>
> SSH messages to keep those connections up. I now use the same options<br>
> for standard networks (real speeds).<br>
<br>
Hmm. I forgot about that. However, the man page for ssh_config states <br>
that tcpkeepalive is on by default. So...<br>
<br>
I think we're seeing the ssh sessions die because the Sonicwall VPN is <br>
configured to kill any connections after xx time. I cannot get that <br>
changed.<u></u><u></u></span></p>
</blockquote>
<p class="MsoNormal"><span style="font-size:12pt;font-family:Arial,sans-serif;color:black">Dumb NAT firewall. SSH will NOT send any traffic unless there is traffic to send. If SSH is your only connection then the dumb NAT firewawll will only see packets
duing standard TCP keep alive or when SSH sends data. To fix that firewall you need to tell SSH to send data!<u></u><u></u></span></p>
<div>
<p class="MsoNormal"><span style="font-size:12pt;font-family:Arial,sans-serif;color:black"><u></u> <u></u></span></p>
</div>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12pt;font-family:Arial,sans-serif;color:black"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12pt;font-family:Arial,sans-serif;color:black">ssh -o ServerAliveInterval=20 -o ServerAliveCount=5
<a href="mailto:user@host" target="_blank">user@host</a><u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12pt;font-family:Arial,sans-serif;color:black"><u></u> <u></u></span></p>
</div>
</div>
</div>
</div>
_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org" target="_blank">Ale@ale.org</a><br>
<a href="https://mail.ale.org/mailman/listinfo/ale" rel="noreferrer" target="_blank">https://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" rel="noreferrer" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"> Ed Cashin <<a href="mailto:ecashin@noserose.net" target="_blank">ecashin@noserose.net</a>></div></div>