File: source_nginx.py

package info (click to toggle)
nginx 1.28.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 9,696 kB
  • sloc: ansic: 169,569; sh: 623; perl: 439; python: 240; makefile: 130; cpp: 19
file content (19 lines) | stat: -rw-r--r-- 647 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
'''
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]