#27 closed defect

twistd doesn't daemonize on windows — at Version 15

Reported by: zooko Owned by: zooko
Priority: major Milestone: eventually
Component: code-nodeadmin Version: 0.7.0
Keywords: windows twisted docs Cc: zooko
Launchpad Bug:

Description (last modified by zooko)

On Windows, Twistd doesn't write pid file (as per Twisted #2646), nor does the call to twistd exit so that you get your shell back. But it does start not one but two "python.exe" processes, which will continue running if you C-c the call to twistd and get your shell back.

To close this ticket, fix it so that twistd works the same on Windows as on all other operating systems that we support, or at least figure out what the heck is going on and document it.

Change History (15)

comment:1 Changed at 2007-05-27T14:53:53Z by zooko

  • Owner changed from somebody to zooko
  • Status changed from new to assigned

comment:2 Changed at 2007-08-20T17:50:18Z by zooko

In fact, it doesn't seem to launch a separate process at all on Windows or Cygwin -- it just keeps running and sending logging to stdout.

This is a ticket general to Twisted. It would probably make sense to submit a bug report at http://twistedmatrix.com . It might be fun for Allmydata, Inc. to fund a bug bounty program for tickets like these which are important to us but which lie outside of our code base proper.

comment:3 Changed at 2007-08-20T17:50:24Z by zooko

  • Milestone set to 0.6.0

comment:4 Changed at 2007-09-04T16:05:03Z by warner

it might make sense for our /usr/bin/allmydata-tahoe tool to offer a 'run' command instead of start/stop, since the cygwin form doesn't fork().

comment:5 Changed at 2007-09-19T03:40:20Z by warner

I've confirmed that the cygwin form does indeed fork. I'm still seeing some test problems, but I think in general cygwin should behave posixly-enough to use 'tahoe start' as usual.

The native windows form probably can't, though.

comment:6 Changed at 2007-09-19T22:54:24Z by zooko

See also Twisted ticket 2646:

http://twistedmatrix.com/trac/ticket/2646

comment:7 Changed at 2007-09-20T16:03:38Z by zooko

  • Milestone changed from 0.6.0 to 0.6.1

comment:8 Changed at 2007-09-24T02:19:30Z by zooko

Actually there *are* two long-running python.exe processes launched by running allmydata-tahoe... I haven't investigated further yet.

comment:9 Changed at 2007-09-25T18:44:50Z by zooko

  • Summary changed from twistd can't find its pid file on Windows to twistd doesn't daemonize on windows

comment:10 Changed at 2007-10-01T19:35:20Z by zooko

  • Description modified (diff)
  • Milestone changed from 0.6.1 to undecided

comment:11 Changed at 2007-10-13T22:35:14Z by zooko

  • Component changed from code to code-nodeadmin
  • Milestone changed from undecided to 0.7.0
  • Version set to 0.6.0

There is something that we are really misunderstanding here.

If you run "tahoe start" on Windows (with current trunk -- af0edec753033339), then the command-line (in my case bash in rxvt windows, but don't let that trick you into thinking that this is a cygwin version of Python, or of any of the libraries) hangs and waits, and two python.exe processes start.

If you then hit C-c you get your bash prompt back, but the two processes continue to run, and the tahoe node continues to log things to twistd.log and to be work when you connect to it with your web browesr.

Unfortunately we can't use "tahoe stop" to kill them, because they didn't write their pids, because of twisted #2646.

(Also perhaps because "tahoe stop" doesn't know how to kill processes on Windows.)

comment:12 Changed at 2007-10-17T04:39:02Z by zooko

  • Cc zooko added

Testing trac mail Cc:.

comment:13 Changed at 2007-10-19T23:08:06Z by zooko

  • Milestone changed from 0.7.0 to 0.6.2
  • Version changed from 0.6.0 to 0.6.1

I'm going to look at this for v0.6.2.

comment:14 Changed at 2007-10-19T23:08:14Z by zooko

Because I love Windows so much.

comment:15 Changed at 2007-10-22T23:33:53Z by zooko

  • Description modified (diff)
Note: See TracTickets for help on using tickets.