twistd doesn't daemonize on windows #27

Closed
opened 2007-05-02 23:00:48 +00:00 by zooko · 16 comments

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.

On Windows, Twistd doesn't write pid file (as per [Twisted #2646](http://twistedmatrix.com/trac/ticket/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.
zooko added the
code
major
defect
labels 2007-05-02 23:00:48 +00:00
Author

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.

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.
zooko added this to the 0.6.0 milestone 2007-08-20 17:50:24 +00:00

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().

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().

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.

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.
Author

See also Twisted ticket 2646:

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

See also Twisted ticket 2646: <http://twistedmatrix.com/trac/ticket/2646>
zooko modified the milestone from 0.6.0 to 0.6.1 2007-09-20 16:03:38 +00:00
Author

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

Actually there *are* two long-running python.exe processes launched by running allmydata-tahoe... I haven't investigated further yet.
zooko changed title from twistd can't find its pid file on Windows to twistd doesn't daemonize on windows 2007-09-25 18:44:50 +00:00
zooko modified the milestone from 0.6.1 to undecided 2007-10-01 19:35:20 +00:00
Author

There is something that we are really misunderstanding here.

If you run "tahoe start" on Windows (with current trunk -- changeset: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.)

There is something that we are really misunderstanding here. If you run "tahoe start" on Windows (with current trunk -- changeset: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](http://twistedmatrix.com/trac/ticket/2646). (Also perhaps because "tahoe stop" doesn't know [how to kill processes on Windows](http://google.com/search?q=kill+processes+on+windows).)
zooko added
code-nodeadmin
0.6.0
and removed
code
labels 2007-10-13 22:35:14 +00:00
zooko modified the milestone from undecided to 0.7.0 2007-10-13 22:35:14 +00:00
Author

Testing trac mail Cc:.

Testing trac mail Cc:.
Author

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

I'm going to look at this for v0.6.2.
zooko added
0.6.1
and removed
0.6.0
labels 2007-10-19 23:08:06 +00:00
Author

Because I love Windows so much.

Because I love Windows so much.
Author

We're focussing on an imminent v0.7.0 (see the roadmap) which hopefully has [#197 Small Distributed Mutable Files] and also a fix for [#199 bad SHA-256]. So I'm bumping less urgent tickets to v0.7.1.

We're focussing on an imminent v0.7.0 (see [the roadmap](http://allmydata.org/trac/tahoe/roadmap)) which hopefully has [#197 Small Distributed Mutable Files] and also a fix for [#199 bad SHA-256]. So I'm bumping less urgent tickets to v0.7.1.
Author

We need to choose a manageable subset of desired improvements for v0.7.1, scheduled for two week hence, so I'm bumping this one into v0.7.2, scheduled for mid-December.

We need to choose a manageable subset of desired improvements for [v0.7.1](http://allmydata.org/trac/tahoe/milestone/0.7.1), scheduled for two week hence, so I'm bumping this one into [v0.7.2](http://allmydata.org/trac/tahoe/milestone/0.7.2), scheduled for mid-December.
zooko added
0.7.0
and removed
0.6.1
labels 2007-11-13 18:21:52 +00:00
Author

Rob has worked-around this by making a "tahoe run" command changeset:9ed5533760d959b6 which runs the node in the calling process and by making "start" optional and not enabled by default on Windows.

It would still be nice if Twisted would abstract this kind of thing for us so that we didn't have to know what operating system we were on when we use twistd.

Rob has worked-around this by making a "tahoe run" command changeset:9ed5533760d959b6 which runs the node in the calling process and by making "start" optional and not enabled by default on Windows. It would still be nice if Twisted would abstract this kind of thing for us so that we didn't have to know what operating system we were on when we use twistd.
zooko added this to the undecided milestone 2008-01-23 03:26:36 +00:00
Author

See also http://twistedmatrix.com/trac/ticket/102 -- "Support running Twisted code as NT services on Win32." -- and the latest comments on http://twistedmatrix.com/trac/ticket/2646 -- "twistd should write a pidfile on win32".

See also <http://twistedmatrix.com/trac/ticket/102> -- "Support running Twisted code as NT services on Win32." -- and the latest comments on <http://twistedmatrix.com/trac/ticket/2646> -- "twistd should write a pidfile on win32".
davidsarah commented 2010-07-15 00:39:25 +00:00
Owner

This ticket is about not forking when using native Windows Python; nothing to do with cygwin.

This ticket is about not forking when using native Windows Python; nothing to do with cygwin.
davidsarah commented 2012-11-22 00:49:10 +00:00
Owner

There hasn't been any significant activity on http://twistedmatrix.com/trac/ticket/2646 for 5 years, so Twisted probably won't fix this.

There hasn't been any significant activity on <http://twistedmatrix.com/trac/ticket/2646> for 5 years, so Twisted probably won't fix this.

Daemonization in the "tahoe" script is now deprecated and will probably be removed after the next release.

https://tahoe-lafs.org/trac/tahoe-lafs/ticket/3273

Daemonization in the "tahoe" script is now deprecated and will probably be removed after the next release. <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/3273>
exarkun added the
wontfix
label 2020-01-16 19:31:10 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Reference: tahoe-lafs/trac-2024-07-25#27
No description provided.