1

If Python's mod_wsgi-express starts in a terminal, which is then resized, the server shuts down. This seems to be due to Apache interpreting the SIG_WINCH. Can this be disabled in any way?

The naive way to catch it using signal.signal(signal.SIGWINCH, signal.SIG_IGN) is blocked: http://modwsgi.readthedocs.io/en/develop/configuration-directives/WSGIRestrictSignal.html.

Is it possible to somehow ignore this signal, either in code or during the command-line mod_wsgi-express?

M K
  • 406
  • 1
  • 3
  • 9

1 Answers1

0

Use:

mod_wsgi-express start-server --isatty

This enables a check which looks to see if you are running in a TTY and when you are starts up Apache with a wrapper script that suppresses SIGWINCH. It currently requires the command line option to allow the feature to be tested before making it the default to check. This is being done to avoid potential for issues with existing setups before known it works reliably.

You can find details of the command line options by running:

mod_wsgi-express start-server --help

You need a reasonably recent mod_wsgi version for this option.

Also, trying to block it from your Python code wouldn't make any difference as it is the Apache parent process which intercepts the signal and shuts down. This is why need to invoke it with a wrapper which ignores it.

Graham Dumpleton
  • 57,726
  • 6
  • 119
  • 134
  • 1
    Thank you, also for `mod_wsgi`. Seems like the version needs to be >4.6 as of https://github.com/GrahamDumpleton/mod_wsgi/blob/a95f9bbf6efa8a60c67fb6b6065a4e041c77b93c/docs/release-notes/version-4.6.0.rst? – M K Apr 12 '18 at 10:39