To me this seems like a very strange problem and I&#39;ve tried to debug it best I can but I don&#39;t know much about many of the components at work. Here&#39;s what happened:<br><br><div>I&#39;ve been happily using Capistrano to deploy many twistd services to Ubuntu 9.04 machines. It restarts them via an init.d script based off this template: <a href="http://twistedmatrix.com/trac/attachment/ticket/3434/twistdplugin">http://twistedmatrix.com/trac/attachment/ticket/3434/twistdplugin</a>. I&#39;m running a self-installed Twisted 8.2.0 on both systems with some small tweaks to logging.<br>

<br></div><div>On newer Ubuntu 10.04 machines I&#39;ve been deploying to the twistd services don&#39;t restart properly. There are no errors in the log. The only log lines I&#39;d get were:<br>[-] Log opened.<br>[-] twistd 8.2.0 (/usr/bin/python 2.6.5) starting up.<br>

[-] reactor class: twisted.internet.epollreactor.EPollReactor.<br><br></div><div>But they were only failing to restart when run via Capistrano. I realized that the only difference was that Capistrano was using a pseudo terminal when it issued its commands. To recreate the problem without Capistrano I can run:</div>

<div>&gt; ssh -t user@host &quot;/etc/init.d/service start&quot;</div><div><br></div><div>But it works fine when I run:</div><div><div>&gt; ssh user@host &quot;/etc/init.d/service start&quot;</div></div><div><br></div><div>

The 3 log lines I see in the failed case are written by twistd before it forks (clone() syscall) to create the daemon process. The strace dump of twistd when run with and without pseudo terminal were identical. I tried running strace with the -f option to get some info about the child process but it didn&#39;t fail in that case since I guess it doesn&#39;t actually fork. Running in a pseudo terminal with --nodaemon passed to twistd also works fine.</div>

<div><br></div><div>I&#39;ve tested this with multiple twistd services and am having the same issue with all of them.</div><div><br></div><div>Any ideas? Did I completely misdiagnose the problem? Has there been some change in this area between Twisted 8.2.0 and 10.x? I&#39;m certainly confused. :)</div>

<div><br></div><div>- Garret</div><div><br></div>