When you run ./a.out in a terminal over SSH, and then the SSH session times out, ./a.out is killed. Why is this? Some say that it's because of SIGHUP. But running nohup ./a.out still has the same problem in that when the SSH session times out, the nohup ./a.out process is still killed.
I've seen some say that it's because children are killed when the parent is killed. But I've seen it claimed elsewhere that this isn't normally the case.
An alternative explanation is that the stdout of ./a.out is tied to the terminal. Thus, after the terminal is killed, when ./a.out tries writing to the terminal, it will receive a SIGPIPE, which will cause it to be killed.
What is the real reason why nohup ./a.out dies when SSH times out?
Here is the actual command I'm running: nohup ./a.out |& tee logs.out