Univention Bugzilla – Attachment 6647 Details for
Bug 36044
Connection to download server updates.software-univention.de gets stuck / stalls
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Collect stall info
36044_apt-stall.py (text/plain), 1.61 KB, created by
Philipp Hahn
on 2015-02-05 14:24:50 CET
(
hide
)
Description:
Collect stall info
Filename:
MIME Type:
Creator:
Philipp Hahn
Created:
2015-02-05 14:24:50 CET
Size:
1.61 KB
patch
obsolete
>#!/usr/bin/env python >""" >Connection to download server updates.software-univention.de gets stuck / stalls >""" >import os >from subprocess import Popen, PIPE > >SERVER = 'download2.software-univention.de' > > >def _cmd(func, *cmd): > print '# %s' % (' '.join(cmd),) > proc = Popen(cmd, stdout=PIPE) > for line in proc.stdout: > line = line.rstrip() > line = func(line) > if line: > print line > > >def cmd(*cmd): > _cmd(lambda l: l, *cmd) > print > > >def date(): > cmd('date', '--rfc-3339=date') > > >def ifstat(): > for iface in os.listdir('/sys/class/net'): > cmd('ip', '-s', 'link', 'show', iface) > > >def netstat(): > f = lambda line: line if SERVER in line else None > _cmd(f, 'netstat', '-tp') > > >def route(): > f = lambda line: cmd('ip', 'route', 'get', line) or line > _cmd(f, 'dig', '+short', SERVER) > > >def lsof(): > pids = set() > > def f(line): > if SERVER in line: > command, pid, user, fd, typ, device, size_off, node, name = line.split(None, 8) > pids.add(pid) > return line > > _cmd(f, 'lsof') > return pids > > >def proc(pids): > if pids: > cmd('ps', 'afwwwu', *list(pids)) > > >def strace(pids): > for pid in pids: > cmd('timeout', '1s', 'strace', '-q', '-p', pid) > > >def ucr(): > f = lambda line: None if 'password' in line else line > _cmd(f, 'ucr', 'search', '--brief', '--non-empty', '^repository/') > > >def bugzilla(): > try: > import sys > sys.path.insert(0, "/home/phahn/src") > from bugzilla import BugzillaJson as Bugzilla > except ImportError: > return > bug = Bugzilla() > bug.get(36044) > > >def main(): > os.environ['LC_ALL'] = 'C' > > bugzilla() > > date() > ifstat() > netstat() > route() > pids = lsof() > proc(pids) > strace(pids) > ucr() > > >if __name__ == '__main__': > main()
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 36044
: 6647