[Twisted-Python] Unable to start twistd service on Ubuntu 10.04 when using pseudo terminal

Garret Heaton powdahound at gmail.com
Wed Sep 29 13:48:30 EDT 2010

I've simplified this issue down and am able to reproduce it without
Twisted: http://gist.github.com/603154

Still not sure what the cause is, so if anyone has any ideas I'd love to
hear them. Thanks!

On Mon, Sep 27, 2010 at 8:15 PM, Garret Heaton <powdahound at gmail.com> wrote:

> To me this seems like a very strange problem and I've tried to debug it
> best I can but I don't know much about many of the components at work.
> Here's what happened:
> I'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:
> http://twistedmatrix.com/trac/attachment/ticket/3434/twistdplugin. I'm
> running a self-installed Twisted 8.2.0 on both systems with some small
> tweaks to logging.
> On newer Ubuntu 10.04 machines I've been deploying to the twistd services
> don't restart properly. There are no errors in the log. The only log lines
> I'd get were:
> [-] Log opened.
> [-] twistd 8.2.0 (/usr/bin/python 2.6.5) starting up.
> [-] reactor class: twisted.internet.epollreactor.EPollReactor.
> 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:
> > ssh -t user at host "/etc/init.d/service start"
> But it works fine when I run:
> > ssh user at host "/etc/init.d/service start"
> 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't fail in that case since I guess it doesn't actually fork.
> Running in a pseudo terminal with --nodaemon passed to twistd also works
> fine.
> I've tested this with multiple twistd services and am having the same issue
> with all of them.
> 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'm certainly confused.
> :)
> - Garret
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20100929/1c52aeca/attachment.htm 

More information about the Twisted-Python mailing list