Move Process from disconnected SSH session

GNU screen or tmux are great utilities but some times one of your ssh connection is disconnected and process running there vanishes to background on the same pts . My computer running Windows 10 was rebooted due to great windows update active hours settings and there was some apt thing running stopped on some dialog waiting for input.

After some struggle I found about reptyr and that thing saved my day . Just download from https://github.com/nelhage/reptyr .

wget  https://github.com/nelhage/reptyr/archive/reptyr-0.7.0.tar.gz
tar -xzvf reptyr-0.7.0.tar.gz
cd reptyr-reptyr-0.7.0/
make
make install

With minimal Debian web server install above commands installed the reptyr on my machine. Next is few easy steps to get the process moved to new shell session

ps ax | grep myprocess
reptyr PID
......

Get the PID and use this with reptyr command as above . Process for disconnected session will appear from where it was stopped.


Posted

in

by

Tags: