Summary: Unable to automate commands to Twisted's manhole. Seeking solutions/advice.
Twisted has a great piece of functionality called manhole. It allows the user to ssh to a currently running Twisted server and inspect/interact with its internals.
I would like to do some scripting with this. Connecting to manhole simply requires
ssh localhost -p 12345
and then the user is dropped into a Python interpreter with access to the running process.
Usually with ssh one can run a command on the remote server and exit, e.g.
ssh foo@bar.com 'ls'
will execute 'ls' on the login directory and then the ssh connection will close.
I would like to perform something like
ssh localhost -p 12345 'print "hello, world"'
to manhole, but instead I receive (with ssh verbose):
debug1: Authentication succeeded (password).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
debug1: Sending command: print "Hello world"
exec request failed on channel 0
Anyway I can automate operations on manhole?