aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xwhatmaps26
1 files changed, 24 insertions, 2 deletions
diff --git a/whatmaps b/whatmaps
index 155a56c..74168c3 100755
--- a/whatmaps
+++ b/whatmaps
@@ -1,7 +1,7 @@
#!/usr/bin/python -u
# vim: set fileencoding=utf-8 :
#
-# (C) 2010 Guido Guenther <agx@sigxcpu.org>
+# (C) 2010,2014 Guido G√ľnther <agx@sigxcpu.org>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
@@ -95,6 +95,9 @@ class Distro(object):
@cvar id: distro id as returned by lsb-release
"""
id = None
+ service_blacklist = set()
+ _pkg_services = {}
+ _pkg_blacklist = {}
@classmethod
def pkg(klass, name):
@@ -128,6 +131,17 @@ class Distro(object):
return []
@classmethod
+ def pkg_service_blacklist(klass, pkg):
+ """
+ List of services in pkg that we don't want to be restarted even when
+ a binary from this package maps a shared lib that changed.
+ """
+ try:
+ return klass._pkg_service_blacklist[pkg.name]
+ except KeyError:
+ return []
+
+ @classmethod
def has_apt(klass):
"""Does the distribution use apt"""
return False
@@ -191,6 +205,12 @@ class DebianDistro(Distro):
'exim4-daemon-heavy': [ 'exim4' ],
}
+ # Per package blacklist
+ _pkg_service_blacklist = { 'libvirt-bin': [ 'libvirt-guests' ] }
+
+ # Per distro blacklist
+ service_blacklist = set(['kvm', 'qemu-kvm', 'qemu-system-x86'])
+
@classmethod
def pkg(klass, name):
return DebianPkg(name)
@@ -549,12 +569,14 @@ def main(argv):
all_services = set()
try:
for pkg in pkgs.values():
- services = pkg.services + distro.pkg_services(pkg)
+ services = set(pkg.services + distro.pkg_services(pkg))
+ services -= set(distro.pkg_service_blacklist(pkg))
if not services:
logging.warning("No service script found in '%s' for '%s' "
"- restart manually" % (pkg.name, pkg.procs))
else:
all_services.update(services)
+ all_services -= distro.service_blacklist
except NotImplementedError:
if level > logging.INFO:
logging.error("Getting Service listing not implemented "