[CentOS] sidekiq receives SIGHUP when started via ssh -t

Mon Oct 16 17:23:36 UTC 2017
Yuri Kanivetsky <yuri.kanivetsky at gmail.com>

Hi,

I was able to narrow it down to this ruby script:

#!/usr/bin/env ruby
Process.daemon
while true
        sleep 1
end

And I can reproduce it on one particular CentOS server, on the other
CentOS server it works as on Ubuntu. The CentOS server where I can
reproduce the issue is supposed to have vanilla CentOS, but probably
not exactly.

So, when I run it this way on CentOS 7:

ssh user at example.com -t '. ~/.bash_profile && rvm 2.3.1 && cd 1 && ./1.rb'

script doesn't stay, without -t it does. Under Ubuntu 16.04 it stays
in both cases.

I tried to reproduce it with bash:

#!/usr/bin/env bash
(setsid bash -c 'exec > /dev/null 2>&1 < /dev/null; while true; do
        sleep 1
done') &

But it behaves consistently across servers (with -t terminates on any
server I tried, without -t stays). I might be missing something here.

Any ideas are welcome. Like, what to check? Where and what to ask?

Regards,
Yuri