summaryrefslogtreecommitdiff
path: root/debian/mariadb-server-10.1.py
diff options
context:
space:
mode:
authorOtto Kekäläinen <otto@seravo.fi>2015-07-21 23:13:05 +0300
committerOtto Kekäläinen <otto@seravo.fi>2015-07-21 23:21:50 +0300
commit82e64fde07caa9cc2e175fadeda72f3948aee437 (patch)
treec69c5497a39c0ebcbed86ad4cdb79e9f907296f6 /debian/mariadb-server-10.1.py
parent6d3bd6588e725362098054e07f8f5994d5ab4bfa (diff)
downloadmariadb-git-82e64fde07caa9cc2e175fadeda72f3948aee437.tar.gz
Remove debian/dist/* and have just one version
Use the slightly better Ubuntu version in both Ubuntu and Debian and latest versions of Debian don't have problems with AppArmor files included in packaging.
Diffstat (limited to 'debian/mariadb-server-10.1.py')
-rw-r--r--debian/mariadb-server-10.1.py52
1 files changed, 52 insertions, 0 deletions
diff --git a/debian/mariadb-server-10.1.py b/debian/mariadb-server-10.1.py
new file mode 100644
index 00000000000..fe5029d056c
--- /dev/null
+++ b/debian/mariadb-server-10.1.py
@@ -0,0 +1,52 @@
+'''apport package hook for mariadb-10.1
+
+(c) 2009 Canonical Ltd.
+Author: Mathias Gug <mathias.gug@canonical.com>
+'''
+
+import os, os.path
+
+from apport.hookutils import *
+
+def _add_my_conf_files(report, filename):
+ key = 'MySQLConf' + path_to_key(filename)
+ report[key] = ""
+ for line in read_file(filename).split('\n'):
+ try:
+ if 'password' in line.split('=')[0]:
+ line = "%s = @@APPORTREPLACED@@" % (line.split('=')[0])
+ report[key] += line + '\n'
+ except IndexError:
+ continue
+
+def add_info(report):
+ attach_conffiles(report, 'mariadb-server-10.1', conffiles=None)
+ key = 'Logs' + path_to_key('/var/log/daemon.log')
+ report[key] = ""
+ for line in read_file('/var/log/daemon.log').split('\n'):
+ try:
+ if 'mysqld' in line.split()[4]:
+ report[key] += line + '\n'
+ except IndexError:
+ continue
+ key = 'Logs' + path_to_key('/var/log/kern.log')
+ report[key] = ""
+ for line in read_file('/var/log/kern.log').split('\n'):
+ try:
+ if '/usr/sbin/mysqld' in string.join(line.split()[4:]):
+ report[key] += line + '\n'
+ except IndexError:
+ continue
+ _add_my_conf_files(report, '/etc/mysql/my.cnf')
+ for f in os.listdir('/etc/mysql/conf.d'):
+ _add_my_conf_files(report, os.path.join('/etc/mysql/conf.d', f))
+ try:
+ report['MySQLVarLibDirListing'] = unicode(os.listdir('/var/lib/mysql'))
+ except OSError:
+ report['MySQLVarLibDirListing'] = unicode(False)
+
+if __name__ == '__main__':
+ report = {}
+ add_info(report)
+ for key in report:
+ print '%s: %s' % (key, report[key].split('\n', 1)[0])