Write a script that does this:
#!/bin/bash
trap 'echo hup' hup
trap 'echo int' int
trap 'echo quit' quit
trap 'echo abrt' abrt
trap 'echo kill' kill
trap 'echo usr1' usr1
trap 'echo usr2' usr2
trap 'echo term' term
trap 'echo chld' chld
trap 'echo cont' cont
trap 'echo stop' stop
trap 'echo tstp' tstp
trap 'echo ttin' ttin
trap 'echo ttou' ttou
shopt huponexit
sleep 10
echo $(date) process $$ done
Write a second script that does : > nohup.out; nohup firstscript& echo sleeping; sleep 10
. Run the second script, wait a second or two, then close your PuTTY terminal. Open a new PuTTY terminal and inspect the nohup.out file. It should tell you what signal the first script received that made it stop. That will help you figure out how to proceed. You could try doing trap '' THEGUILTYSIGNAL
for one thing.
It should also tell you the huponexit value. If this is on, you could experiment with shopt -u huponexit
and see if that improves matters. (Improvement = you can run the second script then close your PuTTY terminal but the first script still runs to completion.)