Reptyr – Forgot to “screen” your ssh session first, and now that long running…
Posted by jpluimers on 2018/12/24
From a while back, but still so cool! It allows you to “recover” the terminal (stdin/stdout/stderr) of a process that was attached to a terminal or ssh session.
Reptyr – Forgot to “screen” your ssh session first, and now that long running thing is stuck?
»
reptyr PIDwill grab the process with id PID and attach it to your current terminal.«server:~ # zypper install reptyr ... Retrieving: reptyr-0.3dev_git20120325-7.1.2.x86_64.rpm ...................[done] (1/1) Installing: reptyr-0.3dev_git20120325-7.1.2 ........................[done] server:~ # rpm -qi reptyr ... Summary : A tool for "re-ptying" programs Description : reptyr is a utility for taking an existing running program and attaching it to a new terminal. Started a long-running process over ssh, but have to leave and don't want to interrupt it? Just start a screen, use reptyr to grab it, and then kill the ssh session and head on home. Distribution: openSUSE 13.1
Source: [WayBack] Reptyr – Forgot to “screen” your ssh session first, and now that long running thing is stuck?… – Kristian Köhntopp – Google+
It works with tmux too and is supported on many Linux distributions, see for instance [WayBack] Reptyr – Move A Running Process From One Terminal To Another Without Closing It – OSTechNix.
You can even redirect a pty for gdb usage: [WayBack] reptyr(1): new terminal – Linux man page
StackExchange thread: [WayBack] How to recover a shell after a disconnection with these entries:
- [WayBack] Comment1
- [WayBack] Comment2
- [WayBack] Answer
- Blog entry:[WayBack] Made of Bugs – reptyr: Attach a running process to a new terminal
Originally from 2011 [WayBack] reptyr: Attach a running process to a new terminal – Made of Bugs it is still maintained:
GitHub repository [WayBack] nelhage/reptyr: Reparent a running program to a new terminal
–jeroen






Leave a comment