https://review.openstack.org/#/c/223066/1 -- guru_meditation_report: Use SIGUSR2 instead of SIGUSR1 [Daniel Berrange] I'd really be strongly against having applications pass in the required signal, because I think it is important that we have a consistent signal used across all openstack projects. If we have different signals in different projects, then you increase the complexity for admins by making them remember different signals for each process. This in turn *will* lead to admin mistakes where they send the wrong signal, which will lead to the app taking the wrong action. [From Joshua Harlow]: What about something like: http://paste.openstack.org/show/465087/ import signal def _try_set_signal(func, signum, *signums): sigs_to_try = [signum] sigs_to_try.extend(signums) for signum in sigs_to_try: sig_handler = signal.getsignal(signum) if sig_handler is None or sig_handler in (signal.SIG_DFL, signal.SIG_IGN): signal.signal(signum, func) return signum raise ValueError("Unable to register %s, tried %s" % (func, sigs_to_try)) def a(): pass signum_registered = _try_set_signal(...) LOG.info("YOUR SIGNAL IS %s", signum_registered) The _try_set_signal would be given [function, signum(provided by user if not None), SIGUSR1, SIGUSR2], if none of those work this function will raise a value error (which can be captured if wanted? or logged? or re-raised or something). That way the existing API seems to work as expected and if someone else is using the mentioned signals, then it will not register and the caller can know about that (vs overwriting existing handlers which seems sorta bad). Related reading: https://docs.python.org/2/library/signal.html#signal.getsignal [From Julien Danjaou]: I'm gonna propose my own way of doing it: having an oslo.config option defined here that indicates the default value of SIGUSR2. That means: It works with mod_wsgi by default (like the current patch) It can be changed by the operator as needed It's visible in the default generated configuration file All OpenStack projets have the same default Bonus point if the actual config value is validated at runtime by Joshua's code so the operator has a feedback that it's not going to work. (Though I'm pretty sure there are corner cases where other part of the stack could erase the signal defined by guru meditation, but let's not think about it.)