I have a script I'm creating to spawn netcat listeners on a remote server for copying files at high speeds. The issue I'm running into is that after running the "nohup nc -l -p 12345 | tar -xvf - &" commands I can't get the remote shell to terminate. I'm not sure if this is working as intended or I'm missing something, but a simple test can reproduce the same results:
At a bash shell run the following:
nohup sleep 1000 &
exit
The shell clears screen and hangs until the sleep process is killed or finishes. If you check the process though you can see the shell is no longer the parent process:
[root@test ~]# ps -fea |grep sleep |grep -v grep
root 6990 1 0 12:15 ? 00:00:00 sleep 1000
So, beyond having a comment in my script to have users "ctrl-c" to continue, does anyone have a more elegant solution to kill the shell on the remote server?