<div dir="ltr"><div><div><div><div><div><div><div><div><div>Sometimes I start a process that is going to take far longer than I'm willing to wait on and I forgot to load up a screen session to run in so if my VPN connection dies my process dies with it. Such is the life of an admin.<br>
<br></div>Here's a way to keep sanity a bit higher; transfer the pid to new screen session.<br><br></div>How?<br><br></div>Easy!<br><br></div>You need to have screen (you _do_ have screen, right? <a href="http://jimkinney.us/9.%2Bscreen.html">http://jimkinney.us/9.%2Bscreen.html</a>), reptyr (pronounced re-p-t-y-er) and be running in bash on the remote system.<br>
<br></div>In the shell where the long process is running, hit ctrl-z to pause the process and then run bg to background it.<br></div>Now in another shell on the same system, start a screen session with 'screen'.<br>
</div>In the screen session, run 'reptyr <pid of long process>'<br></div>Now you can ctrl-a d and get off the system entirely and the process will run in the new screen session.<br><br></div>Note: retty (old school version of reptyr) is replaced by reptyr as retty is not happy at all with x86_64.<br clear="all">
<div><div><div><div><div><div><div><div><div><div><br>-- <br><div dir="ltr">-- <br>James P. Kinney III<br><i><i><i><i><br></i></i></i></i>Every time you stop a school, you will have to build a jail. What you
gain at one end you lose at the other. It's like feeding a dog on his
own tail. It won't fatten the dog.<br>
- Speech 11/23/1900 Mark Twain<br><i><i><i><i><br><a href="http://heretothereideas.blogspot.com/" target="_blank">http://heretothereideas.blogspot.com/</a><br></i></i></i></i></div>
</div></div></div></div></div></div></div></div></div></div></div>