The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

    • RT @michaelbolton: 1) Your periodic reminder: a test is not something we *write*. We write text and programs. A test is an experiment you *… 14 minutes ago
    • RT @BiancaPrins: Voor ons allemaal, een #draadje om tot het einde te lezen..... Juist nu (Volgt nog meer in de komende dagen) https://t.co… 15 minutes ago
    • RT @McKayMSmith: 90) His entire life, Ben has chosen to place his faith in the law. “Law, not war” has been his motto for decades. “I hav… 15 minutes ago
    • RT @McKayMSmith: 82) “It's possible to take the most fundamental, strongly held ideas and change them. What makes people change? Sometimes… 17 minutes ago
    • RT @McKayMSmith: 65) “Now I will tell you something very profound, which I have learned after many years. War makes murderers out of otherw… 19 minutes ago
  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,640 other followers

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 PID will 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 [WayBackReptyr – Move A Running Process From One Terminal To Another Without Closing It – OSTechNix.

You can even redirect a pty for gdb usage: [WayBackreptyr(1): new terminal – Linux man page

StackExchange thread: [WayBack] How to recover a shell after a disconnection with these entries:

Originally from 2011 [WayBackreptyr: Attach a running process to a new terminal – Made of Bugs it is still maintained:

GitHub repository [WayBacknelhage/reptyr: Reparent a running program to a new terminal

–jeroen

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

 
%d bloggers like this: