|
NAMEreptyr - Reparent a running program to a new terminalSYNOPSISreptyr PIDreptyr -l|-L [COMMAND [ARGS]] DESCRIPTIONreptyr 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.reptyr works by attaching to the target program using ptrace(2), redirecting relevant file descriptors, and changing the program's controlling terminal (See tty(4)) It is this last detail that makes reptyr work much better than alternatives such as retty(1). After attaching a program, the program will appear to be either backgrounded or suspended to the shell it was launched from (depending on the shell). For maximal safety you can run
in the old shell to remove the association with the program, but reptyr will attempt to ensure that the target program remains running even if you close the shell without doing so. OPTIONS-T
-l, -L [COMMAND [ARGS]]
-s
-v
-h
-V
NOTESreptyr depends on the ptrace(2) system call to attach to the remote program. On Ubuntu Maverick and higher, this ability is disabled by default for security reasons. You can enable it temporarily by doing
as root, or permanently by editing the file /etc/sysctl.d/10-ptrace.conf, which also contains more information about this setting. BUGSWhen attaching to some curses programs, they will not redraw the screen right away, and a ^L or similar will be needed to force a redraw.Similarly, after attaching to certain programs, the old terminal will be left in an odd state, and a clear or even reset may be required before the old terminal is usable again. Attaching to rtorrent (and probably some other apps) doesn't work right (rtorrent stops accepting input) (The problem is that rtorrent is using epoll to poll stdin, and we don't update the internal reference that the epoll fd has to the old tty). Attaching to a process with children doesn't work right. This should be possible to fix -- I just need to ptrace each child individually and do the same games to it. Attaching a less(1) process doesn't work if you have a .lessfilter file, as less leaves around a zombie child in this case. This could be worked around. Bugs should be reported to the author (see below) or via the issue tracker on GitHub. AUTHORSreptyr was written by Nelson Elhage <nelhage@nelhage.com>.HOMEPAGESEE ALSOneercs(1), screen(1)
Visit the GSP FreeBSD Man Page Interface. |