psychoone7 / pyftpdlib

Automatically exported from code.google.com/p/pyftpdlib
Other
0 stars 0 forks source link

serve_forever() and SIGTERM / SIGINT handling #235

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
As of version 0.7.0 pyftpdlib automatically 'handles' SIGTERM (SystemExit) and 
SIGINT (KeyboardInterrupt) signals and executes a cleanup before exiting.
Also, it logs when the server starts and stops.

This behavior is generally desirable but there should be the possibility to 
turn it off so that the user can decide what to do instead (e.g. log another 
message or DO NOT catch the exceptions in the first place or register a signal 
handler).

As such I introduced (r1144) a new 'handle_exit' parameter for 
FTPServer.server_forever() defaulting to True.
The user will tipically do something like this:

try:
    server.server_forever(handle_exit=False)
except (SystemExit, KeyboardInterrupt):
    ...

...or register a signal handler.

Original issue reported on code.google.com by g.rodola on 27 Jan 2013 at 11:05

GoogleCodeExporter commented 9 years ago

Original comment by g.rodola on 27 Jan 2013 at 11:07

GoogleCodeExporter commented 9 years ago
Releasing 1.0.0 just now. Closing.

Original comment by g.rodola on 19 Feb 2013 at 12:49