diff --git a/deployment_scripts/puppet/modules/lma_collector/files/collectd/collectd_apache_check.py b/deployment_scripts/puppet/modules/lma_collector/files/collectd/collectd_apache_check.py index 63ef8551e..790a60f3b 100644 --- a/deployment_scripts/puppet/modules/lma_collector/files/collectd/collectd_apache_check.py +++ b/deployment_scripts/puppet/modules/lma_collector/files/collectd/collectd_apache_check.py @@ -50,10 +50,6 @@ class ApacheCheckPlugin(base.Base): plugin = ApacheCheckPlugin(collectd) -def init_callback(): - plugin.restore_sigchld() - - def config_callback(conf): plugin.config_callback(conf) @@ -61,6 +57,5 @@ def config_callback(conf): def read_callback(): plugin.read_callback() -collectd.register_init(init_callback) collectd.register_config(config_callback) collectd.register_read(read_callback) diff --git a/deployment_scripts/puppet/modules/lma_collector/files/collectd/collectd_base.py b/deployment_scripts/puppet/modules/lma_collector/files/collectd/collectd_base.py index ce73aee36..0ad040529 100644 --- a/deployment_scripts/puppet/modules/lma_collector/files/collectd/collectd_base.py +++ b/deployment_scripts/puppet/modules/lma_collector/files/collectd/collectd_base.py @@ -17,7 +17,6 @@ from functools import wraps import json import signal import subprocess -import sys import time import traceback @@ -224,18 +223,16 @@ class Base(object): @staticmethod def restore_sigchld(): - """Restores the SIGCHLD handler for Python <= v2.6. + """Restores the SIGCHLD handler. This should be provided to collectd as the init callback by plugins - that execute external programs. + that execute external programs and want to check the return code. Note that it will BREAK the exec plugin!!! - See https://github.com/deniszh/collectd-iostat-python/issues/2 for - details. + See contrib/python/getsigchld.py in the collectd project for details. """ - if sys.version_info[0] == 2 and sys.version_info[1] <= 6: - signal.signal(signal.SIGCHLD, signal.SIG_DFL) + signal.signal(signal.SIGCHLD, signal.SIG_DFL) def notification_callback(self, notification): if not self.depends_on_resource: diff --git a/deployment_scripts/puppet/modules/lma_collector/files/collectd/collectd_libvirt_check.py b/deployment_scripts/puppet/modules/lma_collector/files/collectd/collectd_libvirt_check.py index 46606090b..d0df216cc 100644 --- a/deployment_scripts/puppet/modules/lma_collector/files/collectd/collectd_libvirt_check.py +++ b/deployment_scripts/puppet/modules/lma_collector/files/collectd/collectd_libvirt_check.py @@ -49,10 +49,6 @@ class LibvirtCheckPlugin(base.Base): plugin = LibvirtCheckPlugin(collectd) -def init_callback(): - plugin.restore_sigchld() - - def config_callback(conf): plugin.config_callback(conf) @@ -60,6 +56,5 @@ def config_callback(conf): def read_callback(): plugin.read_callback() -collectd.register_init(init_callback) collectd.register_config(config_callback) collectd.register_read(read_callback) diff --git a/deployment_scripts/puppet/modules/lma_collector/files/collectd/collectd_memcached_check.py b/deployment_scripts/puppet/modules/lma_collector/files/collectd/collectd_memcached_check.py index fb44aebf9..5d0dd26a2 100644 --- a/deployment_scripts/puppet/modules/lma_collector/files/collectd/collectd_memcached_check.py +++ b/deployment_scripts/puppet/modules/lma_collector/files/collectd/collectd_memcached_check.py @@ -60,10 +60,6 @@ class MemcachedCheckPlugin(base.Base): plugin = MemcachedCheckPlugin(collectd) -def init_callback(): - plugin.restore_sigchld() - - def config_callback(conf): plugin.config_callback(conf) @@ -71,6 +67,5 @@ def config_callback(conf): def read_callback(): plugin.read_callback() -collectd.register_init(init_callback) collectd.register_config(config_callback) collectd.register_read(read_callback) diff --git a/deployment_scripts/puppet/modules/lma_collector/files/collectd/collectd_mysql_check.py b/deployment_scripts/puppet/modules/lma_collector/files/collectd/collectd_mysql_check.py index a42414c3f..3f598960a 100644 --- a/deployment_scripts/puppet/modules/lma_collector/files/collectd/collectd_mysql_check.py +++ b/deployment_scripts/puppet/modules/lma_collector/files/collectd/collectd_mysql_check.py @@ -103,10 +103,6 @@ class MySQLCheckPlugin(base.Base): plugin = MySQLCheckPlugin(collectd) -def init_callback(): - plugin.restore_sigchld() - - def config_callback(conf): plugin.config_callback(conf) @@ -114,6 +110,5 @@ def config_callback(conf): def read_callback(): plugin.read_callback() -collectd.register_init(init_callback) collectd.register_config(config_callback) collectd.register_read(read_callback) diff --git a/deployment_scripts/puppet/modules/lma_collector/files/collectd/elasticsearch_cluster.py b/deployment_scripts/puppet/modules/lma_collector/files/collectd/elasticsearch_cluster.py index c3dcf378c..5947f6210 100644 --- a/deployment_scripts/puppet/modules/lma_collector/files/collectd/elasticsearch_cluster.py +++ b/deployment_scripts/puppet/modules/lma_collector/files/collectd/elasticsearch_cluster.py @@ -92,10 +92,6 @@ class ElasticsearchClusterHealthPlugin(base.Base): plugin = ElasticsearchClusterHealthPlugin(collectd, 'elasticsearch') -def init_callback(): - plugin.restore_sigchld() - - def config_callback(conf): plugin.config_callback(conf) @@ -103,6 +99,5 @@ def config_callback(conf): def read_callback(): plugin.read_callback() -collectd.register_init(init_callback) collectd.register_config(config_callback) collectd.register_read(read_callback) diff --git a/deployment_scripts/puppet/modules/lma_collector/files/collectd/haproxy.py b/deployment_scripts/puppet/modules/lma_collector/files/collectd/haproxy.py index ca9b9d8ca..2299d6ec7 100644 --- a/deployment_scripts/puppet/modules/lma_collector/files/collectd/haproxy.py +++ b/deployment_scripts/puppet/modules/lma_collector/files/collectd/haproxy.py @@ -307,10 +307,6 @@ class HAProxyPlugin(base.Base): plugin = HAProxyPlugin(collectd) -def init_callback(): - plugin.restore_sigchld() - - def config_callback(conf): plugin.config_callback(conf) @@ -318,6 +314,5 @@ def config_callback(conf): def read_callback(): plugin.read_callback() -collectd.register_init(init_callback) collectd.register_config(config_callback) collectd.register_read(read_callback) diff --git a/deployment_scripts/puppet/modules/lma_collector/files/collectd/influxdb.py b/deployment_scripts/puppet/modules/lma_collector/files/collectd/influxdb.py index 43cd82d50..4b7426b01 100644 --- a/deployment_scripts/puppet/modules/lma_collector/files/collectd/influxdb.py +++ b/deployment_scripts/puppet/modules/lma_collector/files/collectd/influxdb.py @@ -129,10 +129,6 @@ class InfluxDBClusterPlugin(base.Base): plugin = InfluxDBClusterPlugin(collectd) -def init_callback(): - plugin.restore_sigchld() - - def config_callback(conf): plugin.config_callback(conf) @@ -140,6 +136,5 @@ def config_callback(conf): def read_callback(): plugin.read_callback() -collectd.register_init(init_callback) collectd.register_config(config_callback) collectd.register_read(read_callback)