Home | Catalogue | Robert's Blog
Last Updated: [2023-03-29 Wed 07:06]
For all those "I should have f***ing done this in Screen!" moments every Linux SysAdmin Service Delivery agent goes through from time to time.
Firstly, ensure reptyr
is installed.
(More information about what reptyr
is can
be found on the project's GitHub page)
Let's say you're running a task on a Linux box (a Puppet run for
example) either late in the day or late at night. And you suddenly
remember you need to go home, or to bed, but then think "oh noes, this
isn't running in screen
!" You could either
leave your machine at work (a no-go for on callers) or wait it out,
writing a long essay on why Screen is the best thing since sliced bread
to pass the time…
…Or you could do the following:
CTRL+Z
to suspend the current
running process.bg
.jobs -l
. (Let's say the PID is 411)disown puppet
(using puppet as the example
here).screen
command.
(Or you could use tmux
if you like)reptyr 411
.At this point, you should be able to close the whole connection to
the box, and continue later by reconnecting and running screen -R
. (or tmux attach
)
DISCLAIMER: The information provided on this website is generated from my own notes and is provided "as is" and without warranties. Robert Ian Hawdon can not be held responsible for damages caused by following a guide published on this site. This website contains links to other third-party websites. Such links are provided as convienice of the reader. I do not endorce the contents of these third party sites.