HEX
Server: nginx/1.18.0
System: Linux oas2 6.8.0-1039-oracle #40~22.04.1-Ubuntu SMP Wed Oct 29 05:11:00 UTC 2025 aarch64
User: root (0)
PHP: 8.1.2-1ubuntu2.23
Disabled: NONE
Upload Files
File: //usr/share/apport/package-hooks/source_nginx.py
'''
apport package hook for nginx packages

Copyright (c) 2015, Thomas Ward <[email protected]>
'''

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]