HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/share/apport/package-hooks/source_nginx.py
'''
apport package hook for nginx packages

Copyright (c) 2015, Thomas Ward <teward@ubuntu.com>
'''

import apport.hookutils
import os
import subprocess

def add_info(report, ui):
    if (report['Package'].split()[0] != 'nginx-common'
        and report['ProblemType'] == 'Package'
        and os.path.isdir('/run/systemd/system')):
        report['Journalctl_Nginx.txt'] = apport.hookutils.command_output(
            ['journalctl', '-xe', '--unit=nginx.service'])
        report['SystemctlStatusFull_Nginx.txt'] = subprocess.Popen(
            ['systemctl', '-l', 'status', 'nginx.service'],
            stdout=subprocess.PIPE).communicate()[0]