Hi All,<br><br>A day back I install Twisted and Conch on RHEL5. I am a novice user of Twisted software.<br>I copied an example from dev-shed website (attached herewith). This example script uses conch to talk to a ssh deamon.<br>
<br>This script was able to capture and return the output of simple commands such as - ls, cat etc.<br>I mean, when I run the script to execute &#39;ls -al&#39; on a remote machine it does and returns the prompt.<br><br>Where as, when I run the script to execute &#39;<b>tail -f /path/to/mylog.txt</b>&#39; I get the ouput of this command but the prompt never returns.<br>
When I press ^C (Control-C) I get the following run-time error.<br><br><i>Traceback (most recent call last):<br>  File &quot;/usr/lib/python2.4/site-packages/Twisted-8.2.0-py2.4-linux-i686.egg/twisted/internet/tcp.py&quot;, line 520, in connectionLost<br>
    protocol.connectionLost(reason)<br>  File &quot;/usr/lib/python2.4/site-packages/Twisted-8.2.0-py2.4-linux-i686.egg/twisted/conch/ssh/transport.py&quot;, line 166, in connectionLost<br>    self.service.serviceStopped()<br>
  File &quot;/usr/lib/python2.4/site-packages/Twisted-8.2.0-py2.4-linux-i686.egg/twisted/conch/ssh/connection.py&quot;, line 59, in serviceStopped<br>    map(self.channelClosed, self.channels.values())<br>  File &quot;/usr/lib/python2.4/site-packages/Twisted-8.2.0-py2.4-linux-i686.egg/twisted/conch/ssh/connection.py&quot;, line 580, in channelClosed<br>
    log.callWithLogger(channel, channel.closed)<br>--- &lt;exception caught here&gt; ---<br>  File &quot;/usr/lib/python2.4/site-packages/Twisted-8.2.0-py2.4-linux-i686.egg/twisted/python/log.py&quot;, line 84, in callWithLogger<br>
    return callWithContext({&quot;system&quot;: lp}, func, *args, **kw)<br>  File &quot;/usr/lib/python2.4/site-packages/Twisted-8.2.0-py2.4-linux-i686.egg/twisted/python/log.py&quot;, line 69, in callWithContext<br>    return context.call({ILogContext: newCtx}, func, *args, **kw)<br>
  File &quot;/usr/lib/python2.4/site-packages/Twisted-8.2.0-py2.4-linux-i686.egg/twisted/python/context.py&quot;, line 59, in callWithContext<br>    return self.currentContext().callWithContext(ctx, func, *args, **kw)<br>
  File &quot;/usr/lib/python2.4/site-packages/Twisted-8.2.0-py2.4-linux-i686.egg/twisted/python/context.py&quot;, line 37, in callWithContext<br>    return func(*args,**kw)<br>  File &quot;shankha.py&quot;, line 56, in closed<br>
    reactor.stop()<br>  File &quot;/usr/lib/python2.4/site-packages/Twisted-8.2.0-py2.4-linux-i686.egg/twisted/internet/base.py&quot;, line 526, in stop<br>    raise error.ReactorNotRunning(<br>twisted.internet.error.ReactorNotRunning: Can&#39;t stop reactor that isn&#39;t running.</i><br>
<br><br><b>I know that &#39;tail -f&#39; command is expecting &quot;Control-C&quot; or Break to return the prompt on remote host. <br>But my attempt to send the ^C character is failing.. <br><br>I am doing somethink like this:<br>
<br>python sshc.py &lt;hostname&gt; &#39;tail -f mylog.txt ; \x03&#39;<br><br>What is the recommended method to adopt such cases?<br><br></b>Cheers!!<br>Harsha Reddy<br>