Don't ignore SIGPIPE
By default Python configures SIGPIPE to be SIG_IGN, which means to
ignore the signal. We don't want that as it causes problems when
journald restarts and our log calls start triggering SIGPIPEs.
Instead, we want to allow the SIGPIPE to kill the process so it can
be restarted by systemd.
Change-Id: I512139b96b2de8b372efc91e8a3fc8d33553405a
Closes-Bug: 1795030
(cherry picked from commit 4fa30ae5d7
)
This commit is contained in:
parent
11d9fd1593
commit
f63f4d2dc8
|
@ -241,6 +241,9 @@ def getfilehash(files):
|
|||
|
||||
def __main__(args=sys.argv, collector_kwargs_map=None):
|
||||
signal.signal(signal.SIGHUP, reexec_self)
|
||||
# NOTE(bnemec): We need to exit on SIGPIPEs so systemd can restart us.
|
||||
# See lp 1795030
|
||||
signal.signal(signal.SIGPIPE, signal.SIG_DFL)
|
||||
setup_conf()
|
||||
CONF(args=args[1:], prog="os-collect-config",
|
||||
version=version.version_info.version_string())
|
||||
|
|
Loading…
Reference in New Issue