Package: ntp
Version: 1:4.2.8p10+dfsg-1

Hi,
while clearing out for the next merge of ntp in Ubuntu I found that we also
have a helper for apport. Now while Debian doesn't use apport on its own
I've seen plenty of packages carrying the helpers to get the remaining
Delta out.

It would be kind if you could pick the following diff up on the next ntp
packaging round.
In general while not needed it should not hurt the Debian package in any
way.

-- 
Christian Ehrhardt
Software Engineer, Ubuntu Server
Canonical Ltd
From a939d3593eb2804a3eaeed23d8d3cee5848e0227 Mon Sep 17 00:00:00 2001
From: Christian Ehrhardt <[email protected]>
Date: Fri, 1 Jul 2016 10:34:31 +0200
Subject: [PATCH] debian/rules, debian/ntp.dirs, debian/source_ntp.py: Add
 apport hook.

(cherry picked from commit 04302b679bd67dee73de3d87e0d5760a7fe01ec7)
---
 debian/ntp.dirs      |  1 +
 debian/rules         |  3 +++
 debian/source_ntp.py | 22 ++++++++++++++++++++++
 3 files changed, 26 insertions(+)
 create mode 100644 debian/source_ntp.py

diff --git a/debian/ntp.dirs b/debian/ntp.dirs
index 49d3819..46fe52d 100644
--- a/debian/ntp.dirs
+++ b/debian/ntp.dirs
@@ -1,3 +1,4 @@
 usr/sbin
 var/lib/ntp
 var/log/ntpstats
+usr/share/apport/package-hooks
diff --git a/debian/rules b/debian/rules
index 039de91..bd9a80b 100755
--- a/debian/rules
+++ b/debian/rules
@@ -76,6 +76,9 @@ install: build-stamp
 	install -D -m 0644 debian/apparmor-profile.tunable debian/ntp/etc/apparmor.d/tunables/ntpd
 	dh_link -pntp etc/apparmor.d/usr.sbin.ntpd etc/apparmor/init/network-interface-security/usr.sbin.ntpd
 
+	# install apport hook
+	install -D -m 644 debian/source_ntp.py debian/ntp/usr/share/apport/package-hooks/source_ntp.py
+
 	# remove upstream man pages, which are currently not as nice as ours / ntpsnmpd we don't want
 	rm $(addprefix debian/tmp/usr/share/man/man1/,ntpd.1 ntpdc.1 ntp-keygen.1 ntpq.1)
 
diff --git a/debian/source_ntp.py b/debian/source_ntp.py
new file mode 100644
index 0000000..3debc68
--- /dev/null
+++ b/debian/source_ntp.py
@@ -0,0 +1,22 @@
+'''apport package hook for ntp
+
+(c) 2010-2011 Canonical Ltd.
+Author: Chuck Short <[email protected]>
+'''
+
+from apport.hookutils import *
+from os import path
+import re
+
+def add_info(report):
+	attach_conffiles(report, 'ntp')
+
+	# get apparmor stuff
+	attach_mac_events(report, '/usr/sbin/ntpd')
+	attach_file(report, '/etc/apparmor.d/usr.sbin.ntpd')
+
+	# get syslog stuff
+	recent_syslog(re.compile(r'ntpd\['))
+
+	# Get debug information
+	report['NtpStatus'] = command_output(['ntpq', '-p']) 
-- 
2.7.4

Reply via email to