Hmm... So there is no approved way to stop a TGApp server other than
Ctrl+C? (on windows at least)

For my immediate purpose, it's ok to terminate externally (as kill
does on *nix) or from within the app (raise the right exception or
call exit?).

Since win32 TerminateProcess doesn't allow the server to cleanup,
that's apparently not an option. Raising KeyboardInterrupt from within
the controller doesn't work.

I'm trying to understand how Paster server works hoping I'll see a way
out. I find the indirection a bit hair-raising as the code is quite
flexible but unfamiliar to me.

Wish me luck and if anyone has ideas to terminate (with proper
cleanup) on Windows platform, please let me know.



On Apr 30, 10:09 am, Jorge Vargas <[email protected]> wrote:
> On Thu, Apr 30, 2009 at 8:20 AM, Bill5107 <[email protected]> wrote:
>
> > I want to be able to control startup and shutdown of my TG2 app on
> > Windows.
>
> > Currently I simply use  "paster serve myapp.ini"  to start the server,
> > but what is the best way to terminate it? Either from within the tgapp
> > or externally?
>
> I'm not sure about the behavior of it on windows, but on linux paster
> serve --daemon will create a paster.pid file which you can later use
> as kill `cat paster.pid` which is the same as doing ctrl-C on the CLI.
>
> > I need something programatic, so hitting ctrl-C is not a viable
> > option. I didn't see anything in the paster docs and I had nothing to
> > lose so I tried to I raise KeyboardInterrupt or call sys.exit() from a
> > controller.  All I get is a web-presented traceback and the server
> > continues(of course :-) ).
>
> This is a topic I have wanted to  work on for some time but I havent'
> had the time. Ideally we should have some sort of way of writing a
> controller that will allow you to shut down the server. But it gets
> tricky as there is no way to shut it back on. So I guess we'll
> probably need a standalone tgapp to restart the tg app. Suggestions
> are welcome :)
>
> > Thanks in advance.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Trunk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to