Forum: Ruby Hijack: Connect to an existing process with irb

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
3ddf2897026370c1b869159ba19124ec?d=identicon&s=25 Ian Leitch (Guest)
on 2009-07-10 03:55
(Received via mailing list)
Hi,

My new project 'Hijack' is pretty much useable now. It lets you connect
to
an already running ruby process and interact with it using irb as if it
were
a normal irb session.

I'm sure the benefits of this are pretty obvious :)

Github page: http://github.com/ileitch/hijack

Hope someone finds it useful!

Cheers
6c202f0d87225ee60cf8f455431c17a7?d=identicon&s=25 Marcin Raczkowski (Guest)
on 2009-07-10 09:06
(Received via mailing list)
Great. Could you tell me what's the difference from live-console?
Bec38d63650c8912b6ba9b557fb953b9?d=identicon&s=25 Roger Pack (rogerdpack)
on 2009-07-12 05:27
> Great. Could you tell me what's the difference from live-console?

They appear to scratch the same itch :)

Here's a way to do it through EM, too
http://gist.github.com/145471

=r
3ddf2897026370c1b869159ba19124ec?d=identicon&s=25 Ian Leitch (Guest)
on 2009-07-14 22:07
(Received via mailing list)
I've just changed Hijack so that you can hijack any Ruby process - no
need
for your target process to require any code before it can be hijacked.
It
does this by first injecting a payload using gdb, then it signals the
process to start up a DRb server which the hijack client then connects
to.

This should make it a lot more useful as most people probably wouldn't
think
about using something like LiveConsole until a problem is known.. at
which
point you have to enable LiveConsole in your app, restart it and then
wait
for the problem to arise again.

The code is very new and fragile but it'd be great to get some feedback!

2009/7/11 Roger Pack <rogerpack2005@gmail.com>
This topic is locked and can not be replied to.