/
usr
/
share
/
apport
/
package-hooks
/
/usr/share/apport/package-hooks
mkdir
upload
Name
Size
Mode
Actions
cloud-init.py
176
0644
edit
dl
rm
cryptsetup.py
1082
0644
edit
dl
rm
isc-dhcp-client.py
1796
0644
edit
dl
rm
openssh-client.py
1213
0644
edit
dl
rm
openssh-server.py
1004
0644
edit
dl
rm
source_apparmor.py
2831
0644
edit
dl
rm
source_apport.py
569
0644
edit
dl
rm
source_byobu.py
339
0644
edit
dl
rm
source_console-setup.py
374
0644
edit
dl
rm
source_debian-installer.py
1906
0644
edit
dl
rm
source_grub2.py
3782
0644
edit
dl
rm
source_linux-5.4.py
6302
0644
edit
dl
rm
source_linux-firmware.py
6302
0644
edit
dl
rm
source_linux-meta-oem-osp1.py
6302
0644
edit
dl
rm
source_linux-meta-oem.py
6302
0644
edit
dl
rm
source_linux-meta-raspi.py
6302
0644
edit
dl
rm
source_linux-meta.py
6302
0644
edit
dl
rm
source_linux-oem-5.4.py
6302
0644
edit
dl
rm
source_linux-oem-osp1.py
6302
0644
edit
dl
rm
source_linux-oem.py
6302
0644
edit
dl
rm
source_linux-signed-5.4.py
6302
0644
edit
dl
rm
source_linux-signed-oem-5.4.py
6302
0644
edit
dl
rm
source_linux-signed-oem-osp1.py
6302
0644
edit
dl
rm
source_linux-signed-oem.py
6302
0644
edit
dl
rm
source_linux-signed.py
6302
0644
edit
dl
rm
source_linux.py
6302
0644
edit
dl
rm
source_mdadm.py
2252
0644
edit
dl
rm
source_mysql-8.0.py
2521
0644
edit
dl
rm
source_nginx.py
684
0644
edit
dl
rm
source_plymouth.py
1474
0644
edit
dl
rm
source_shadow.py
720
0644
edit
dl
rm
source_shim-signed.py
2000
0644
edit
dl
rm
source_shim.py
2000
0644
edit
dl
rm
source_sudo.py
1159
0644
edit
dl
rm
source_ubiquity.py
7748
0644
edit
dl
rm
source_ubuntu-release-upgrader.py
2238
0644
edit
dl
rm
source_unattended-upgrades.py
705
0644
edit
dl
rm
source_update-manager.py
2290
0644
edit
dl
rm
subiquity.py
1382
0644
edit
dl
rm
systemd.py
872
0644
edit
dl
rm
udev.py
455
0644
edit
dl
rm
Edit:
/usr/share/apport/package-hooks/source_mdadm.py
(2252B)
'''apport package hook for mdadm (c) 2009-2016 Canonical Ltd. Author: Steve Beattie <sbeattie@ubuntu.com> Based on the ideas in debian's /usr/share/bug/mdadm/script ''' from apport.hookutils import attach_file, attach_file_if_exists, attach_hardware, path_to_key, command_output import os import re import glob import gzip import subprocess import sys def get_initrd_files(pattern): '''Extract listing of files from the current initrd which match a regex. pattern should be a "re" object. ''' (_, _, release, _, _) = os.uname() try: fd = gzip.GzipFile('/boot/initrd.img-' + release, 'rb') # universal_newlines needs to be False here as we're passing # binary data from gzip into cpio, which means we'll need to # decode the bytes into strings later when reading the output cpio = subprocess.Popen(['cpio', '-t'], close_fds=True, stderr=subprocess.STDOUT, stdin=subprocess.PIPE, stdout=subprocess.PIPE, universal_newlines=False) except OSError as e: return 'Error: ' + str(e) out = cpio.communicate(fd.read())[0].decode(sys.stdout.encoding, errors='replace') if cpio.returncode != 0: return 'Error: command %s failed with exit code %i %' % ( 'cpio', cpio.returncode, out) lines = ''.join([l for l in out.splitlines(True) if pattern.search(l)]) return lines def add_info(report): attach_hardware(report) attach_file(report, '/proc/mounts', 'ProcMounts') attach_file_if_exists(report, '/etc/mdadm/mdadm.conf', 'mdadm.conf') attach_file(report, '/proc/mdstat', 'ProcMDstat') attach_file(report, '/proc/partitions', 'ProcPartitions') attach_file(report, '/etc/blkid.tab', 'etc.blkid.tab') attach_file_if_exists(report, '/boot/grub/menu.lst', 'GrubMenu.lst') attach_file_if_exists(report, '/boot/grub/grub.cfg', 'Grub.cfg') attach_file_if_exists(report, '/etc/lilo.conf', 'lilo.conf') devices = glob.glob("/dev/[hs]d*") for dev in devices: report['MDadmExamine' + path_to_key(dev)] = command_output(['/sbin/mdadm', '-E', dev]) initrd_re = re.compile('md[a/]') report['initrd.files'] = get_initrd_files(initrd_re)
Save
cmd:
run