aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2014-12-29 11:50:49 +0100
committerGuido Günther <agx@sigxcpu.org>2014-12-29 11:50:49 +0100
commitdbe21fdb47d889262fab32d7c11eeb63d49cb4d1 (patch)
tree655ee8384c20c99bded75e8179c656f50f76be89
parente577fc993402104139679f75b91c3e5cec0883db (diff)
parentd0bdc62cddff86b8601bb0e32b8a115be65032ff (diff)
Merge tag 'debian/0.0.9-1' into bpo/wheezy
whatmaps Debian release 0.0.9-1
-rw-r--r--debian/changelog22
-rw-r--r--debian/patches/0001-Another-import-bugfix.patch27
-rw-r--r--debian/patches/0002-Abort-early-if-we-found-a-match.patch24
-rw-r--r--debian/patches/series2
-rw-r--r--debian/po/sv.po50
-rw-r--r--debian/preinst14
-rwxr-xr-xdebian/tests/smoke2
-rw-r--r--setup.py3
-rwxr-xr-xwhatmaps/command.py13
-rw-r--r--whatmaps/debiandistro.py4
-rw-r--r--whatmaps/process.py2
-rw-r--r--whatmaps/systemd.py8
12 files changed, 102 insertions, 69 deletions
diff --git a/debian/changelog b/debian/changelog
index 8b6b278..ba3c0bd 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,25 @@
+whatmaps (0.0.9-1) unstable; urgency=medium
+
+ * New upstream version:
+ * Install apt.conf configuration on derivatives too (Closes: #761054)
+ * Fix service detection with newer systemd (as in Debian Jessie)
+ * Make logging consistent
+ * [36fd4ee] Avoid error message on missing file.
+ Don't try to get the md5sum of a nonexistent file to avoid
+ md5sum: /etc/apt/apt.conf.d/20servicese: No such file or directory
+ which is confusing.
+ * Drop all patches merged upstream
+
+ -- Guido Günther <agx@sigxcpu.org> Sun, 28 Dec 2014 15:04:26 +0100
+
+whatmaps (0.0.8-5) unstable; urgency=medium
+
+ * [617fed4] Add sv Debconf translation. Thanks to Martin Bagge (Closes:
+ #761973)
+ * [1a7a8b9] Fix smoketest. The name of the libvirt service changed
+
+ -- Guido Günther <agx@sigxcpu.org> Sat, 27 Sep 2014 13:42:48 +0200
+
whatmaps (0.0.8-4~bpo70+1) wheezy-backports; urgency=medium
* Rebuild for wheezy-backports.
diff --git a/debian/patches/0001-Another-import-bugfix.patch b/debian/patches/0001-Another-import-bugfix.patch
deleted file mode 100644
index 9cbb73e..0000000
--- a/debian/patches/0001-Another-import-bugfix.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From: =?utf-8?q?Guido_G=C3=BCnther?= <agx@sigxcpu.org>
-Date: Fri, 11 Jul 2014 20:53:31 +0200
-Subject: Another import bugfix
-
----
- whatmaps/debiandistro.py | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/whatmaps/debiandistro.py b/whatmaps/debiandistro.py
-index 9294c9f..3a3bf16 100644
---- a/whatmaps/debiandistro.py
-+++ b/whatmaps/debiandistro.py
-@@ -31,12 +31,12 @@ import subprocess
- import sys
- import string
-
--import whatmaps.distro
-+from . distro import Distro
- from . debianpkg import DebianPkg
- from . pkg import PkgError
- from . systemd import Systemd
-
--class DebianDistro(whatmaps.distro.Distro):
-+class DebianDistro(Distro):
- "Debian (dpkg) based distribution"
- id = 'Debian'
-
diff --git a/debian/patches/0002-Abort-early-if-we-found-a-match.patch b/debian/patches/0002-Abort-early-if-we-found-a-match.patch
deleted file mode 100644
index 3513ad6..0000000
--- a/debian/patches/0002-Abort-early-if-we-found-a-match.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From: =?utf-8?q?Guido_G=C3=BCnther?= <agx@sigxcpu.org>
-Date: Mon, 14 Jul 2014 16:12:43 +0200
-Subject: Abort early if we found a match
-
-Once we found a shared object that a process maps we don't need to
-continue with the other shared objects since one is enough to require
-a process restart.
----
- whatmaps/command.py | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/whatmaps/command.py b/whatmaps/command.py
-index 7690ef8..e649cbb 100755
---- a/whatmaps/command.py
-+++ b/whatmaps/command.py
-@@ -39,7 +39,7 @@ def check_maps(procs, shared_objects):
- restart_procs[proc.exe] += [ proc ]
- else:
- restart_procs[proc.exe] = [ proc ]
-- continue
-+ break
- return restart_procs
-
-
diff --git a/debian/patches/series b/debian/patches/series
deleted file mode 100644
index 219effd..0000000
--- a/debian/patches/series
+++ /dev/null
@@ -1,2 +0,0 @@
-0001-Another-import-bugfix.patch
-0002-Abort-early-if-we-found-a-match.patch
diff --git a/debian/po/sv.po b/debian/po/sv.po
new file mode 100644
index 0000000..2ee931e
--- /dev/null
+++ b/debian/po/sv.po
@@ -0,0 +1,50 @@
+# Translation of whatmaps debconf template to Swedish
+# Copyright (C) 2014 Martin Bagge <brother@bsnet.se>
+# This file is distributed under the same license as the XX package.
+#
+# Martin Bagge <brother@bsnet.se>, 2014
+msgid ""
+msgstr ""
+"Project-Id-Version: whatmaps\n"
+"Report-Msgid-Bugs-To: whatmaps@packages.debian.org\n"
+"POT-Creation-Date: 2014-08-20 06:56+0200\n"
+"PO-Revision-Date: 2014-09-17 13:22+0100\n"
+"Last-Translator: Martin Bagge / brother <brother@bsnet.se>\n"
+"Language-Team: Swedish <debian-l10n-swedish@lists.debian.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Poedit 1.5.4\n"
+"Language: Swedish\n"
+
+#. Type: boolean
+#. Description
+#: ../templates:2001
+msgid "Automatically restart services after library security updates?"
+msgstr ""
+"Ska tjänster startas om automatiskt efter säkerhetsuppdateringar för "
+"bibliotek?"
+
+#. Type: boolean
+#. Description
+#: ../templates:2001
+msgid ""
+"Services need to be restarted to benefit from updates of shared libraries "
+"they depend on. Otherwise they remain vulnerable to security bugs fixed in "
+"these updates."
+msgstr ""
+"Tjänster behöver startas om för att dra nytta av uppdateringar av delade "
+"bibliotek som de är beroende av. Annars kan tjänsterna fortsätta vara "
+"sårbara för säkerhetsfel som lösts i dessa uppdateringar."
+
+#. Type: boolean
+#. Description
+#: ../templates:2001
+msgid ""
+"Automatic service restarts are only done if APT fetched the library from a "
+"source providing security updates. This also affects packages installed via "
+"\"unattended-upgrades\"."
+msgstr ""
+"Automatiska omstarter av tjänster görs bara om APT hämtar biblioteket från "
+"en källa som tillhandahåller säkerhetsuppdateringar. Detta påverkar också "
+"paket installerade voa \"unattended-upgrades\"."
diff --git a/debian/preinst b/debian/preinst
index 1d54ef0..1ea0c9f 100644
--- a/debian/preinst
+++ b/debian/preinst
@@ -17,12 +17,14 @@ set -e
case "$1" in
install|upgrade)
if dpkg --compare-versions "$2" lt-nl "0.0.8-3~"; then
- # Remove backup copies of services file
- md5=$(md5sum /etc/apt/apt.conf.d/20servicese | sed -e 's/ .*//')
- case "$md5" in
- 074e684668c83b8a98c5eeb8257c88f2|509ad2c35aa4da3153dd6e70941e060b)
- rm -f /etc/apt/apt.conf.d/20servicese
- esac
+ if [ -f /etc/apt/apt.conf.d/20servicese ]; then
+ # Remove errnoneous backup copies of services file
+ md5=$(md5sum /etc/apt/apt.conf.d/20servicese | sed -e 's/ .*//')
+ case "$md5" in
+ 074e684668c83b8a98c5eeb8257c88f2|509ad2c35aa4da3153dd6e70941e060b)
+ rm -f /etc/apt/apt.conf.d/20servicese
+ esac
+ fi
fi
;;
diff --git a/debian/tests/smoke b/debian/tests/smoke
index dde8c37..f4a8642 100755
--- a/debian/tests/smoke
+++ b/debian/tests/smoke
@@ -1,3 +1,3 @@
#!/bin/sh
-whatmaps libvirt0 | grep -qs ^libvirt-bin
+whatmaps libvirt0 | grep -qsE '^(libvirt-bin|libvirtd)'
diff --git a/setup.py b/setup.py
index 7e7ed00..cdadd50 100644
--- a/setup.py
+++ b/setup.py
@@ -21,7 +21,8 @@ data_files = []
try:
import lsb_release
- if lsb_release.get_distro_information()['ID'] in [ 'Debian' ]:
+ if (lsb_release.get_distro_information()['ID'] in [ 'Debian' ] or
+ os.path.exists('/etc/debian_version')):
data_files = [('../etc/apt/apt.conf.d/',
['apt/50whatmaps_apt']),
('../etc/apt/apt.conf.d/',
diff --git a/whatmaps/command.py b/whatmaps/command.py
index 7690ef8..d0f5c3e 100755
--- a/whatmaps/command.py
+++ b/whatmaps/command.py
@@ -39,7 +39,7 @@ def check_maps(procs, shared_objects):
restart_procs[proc.exe] += [ proc ]
else:
restart_procs[proc.exe] = [ proc ]
- continue
+ break
return restart_procs
@@ -59,7 +59,7 @@ def write_cmd_file(services, cmd_file, distro):
out = open(cmd_file, 'w')
print('#! /bin/sh', file=out)
for service in services:
- logging.debug("Need to restart %s", service)
+ logging.info("Need to restart '%s'", service)
print(" ".join(distro.restart_service_cmd(service)), file=out)
out.close()
os.chmod(cmd_file, 0o755)
@@ -113,7 +113,12 @@ def find_systemd_units(procmap, distro):
for dummy, procs in procmap.items():
for proc in procs:
- unit = Systemd.process_to_unit(proc)
+ try:
+ unit = Systemd.process_to_unit(proc)
+ except ValueError as e:
+ logging.warning("No systemd unit found for '%s': %s"
+ "- restart manually" % (proc.exe, e))
+ continue
if not unit:
logging.warning("No systemd unit found for '%s'"
"- restart manually" % proc.exe)
@@ -225,7 +230,7 @@ def main(argv):
write_cmd_file(services, options.print_cmds, distro)
else:
for service in services:
- logging.info("Restarting %s" % service)
+ logging.info("Restarting '%s'" % service)
distro.restart_service(service)
elif services:
print("Services that possibly need to be restarted:")
diff --git a/whatmaps/debiandistro.py b/whatmaps/debiandistro.py
index 9294c9f..3a3bf16 100644
--- a/whatmaps/debiandistro.py
+++ b/whatmaps/debiandistro.py
@@ -31,12 +31,12 @@ import subprocess
import sys
import string
-import whatmaps.distro
+from . distro import Distro
from . debianpkg import DebianPkg
from . pkg import PkgError
from . systemd import Systemd
-class DebianDistro(whatmaps.distro.Distro):
+class DebianDistro(Distro):
"Debian (dpkg) based distribution"
id = 'Debian'
diff --git a/whatmaps/process.py b/whatmaps/process.py
index 1abde23..23ed7ab 100644
--- a/whatmaps/process.py
+++ b/whatmaps/process.py
@@ -36,7 +36,7 @@ class Process(object):
if m:
self.exe = m.group('exe')
self.deleted = True
- logging.info("Using deleted exe %s", self.exe)
+ logging.debug("Using deleted exe %s", self.exe)
if not os.path.exists(self.exe):
logging.debug("%s doesn't exist", self.exe)
self.cmdline = open(self._procpath('%d/cmdline' % self.pid)).read()
diff --git a/whatmaps/systemd.py b/whatmaps/systemd.py
index add6d0e..3407128 100644
--- a/whatmaps/systemd.py
+++ b/whatmaps/systemd.py
@@ -38,4 +38,10 @@ class Systemd(object):
if systemctl_status.returncode:
return None
else:
- return output.split()[0]
+ parts = output.split()
+ if parts[0].endswith('.service'):
+ return parts[0]
+ elif parts[1].endswith('.service'):
+ return parts[1]
+ else:
+ raise ValueError("Can't parse service name from\n%s" % output)