diff options
author | Nikola Pajkovsky <npajkovs@redhat.com> | 2010-05-14 11:47:57 +0200 |
---|---|---|
committer | Nikola Pajkovsky <npajkovs@redhat.com> | 2010-05-14 11:47:57 +0200 |
commit | dbc085851b8084f68622c309011c16e020913896 (patch) | |
tree | 818be74050e0a981ef14fe75267c367a73303043 /src/Hooks | |
parent | ec3f16062651456c79cf5ec54b18759caf515361 (diff) | |
download | abrt-dbc085851b8084f68622c309011c16e020913896.tar.gz abrt-dbc085851b8084f68622c309011c16e020913896.tar.xz abrt-dbc085851b8084f68622c309011c16e020913896.zip |
Revert "Daemon socket for reporting crashes"
This reverts commit 91c7c2ee8fa9ab6c29a7ddc64cff1fa9f5e2918a.
Diffstat (limited to 'src/Hooks')
-rw-r--r-- | src/Hooks/Makefile.am | 5 | ||||
-rw-r--r-- | src/Hooks/abrt_exception_handler.py.in | 26 |
2 files changed, 11 insertions, 20 deletions
diff --git a/src/Hooks/Makefile.am b/src/Hooks/Makefile.am index 3c8aeb94..ef4ab821 100644 --- a/src/Hooks/Makefile.am +++ b/src/Hooks/Makefile.am @@ -47,10 +47,9 @@ EXTRA_DIST = abrt_exception_handler.py.in $(man_MANS) CLEANFILES := $(notdir $(wildcard *~)) $(notdir $(wildcard *\#)) $(notdir $(wildcard \.\#*)) $(notdir $(wildcard *.pyc)) -# Must be synchronized with another sed call below. abrt_exception_handler.py: - sed s,\@VAR_RUN\@,\"$(VAR_RUN)\",g abrt_exception_handler.py.in > abrt_exception_handler.py + sed s,@DEBUG_DUMP_DIR@,$(DEBUG_DUMPS_DIR),g abrt_exception_handler.py.in > abrt_exception_handler.py # RPM fix: we need to regenerate abrt_exception_handler.py, because it has the default ddir install-data-local: - sed s,\@VAR_RUN\@,\"$(VAR_RUN)\",g abrt_exception_handler.py.in > abrt_exception_handler.py + sed s,@DEBUG_DUMP_DIR@,$(DEBUG_DUMPS_DIR),g abrt_exception_handler.py.in > abrt_exception_handler.py diff --git a/src/Hooks/abrt_exception_handler.py.in b/src/Hooks/abrt_exception_handler.py.in index e4c97a94..8a5d8060 100644 --- a/src/Hooks/abrt_exception_handler.py.in +++ b/src/Hooks/abrt_exception_handler.py.in @@ -19,14 +19,13 @@ ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. """ -Module for a ABRT exception handling hook +Module for a userfriendly exception handling """ import sys import os import syslog import subprocess -import socket def write_dump(pid, tb): executable = "Exception raised from python shell" @@ -36,21 +35,14 @@ def write_dump(pid, tb): # during execution? executable = os.path.abspath(sys.argv[0]) - # Open ABRT daemon's socket and write data to it. - s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) - s.connect(@VAR_RUN@ + "/abrt.socket") - s.sendall("NEW\0") - s.sendall("PID=%s\0" % pid) - s.sendall("EXECUTABLE=%s\0" % executable) - s.sendall("BACKTRACE=%s\0" % tb) - s.sendall("ANALYZER=Python\0") - s.sendall("BASENAME=pyhook\0") - # This handler puts a short(er) crash descr in 1st line of the backtrace. - # Example: - # CCMainWindow.py:1:<module>:ZeroDivisionError: integer division or modulo by zero - s.sendall("REASON=%s\0" % tb.splitlines()[0]) - s.sendall("DONE\0") - s.close() + command = ["/usr/libexec/abrt-hook-python"] + command.append("--pid=%s" % pid) + command.append("--executable=%s" % executable) + + helper = subprocess.Popen(command, stdin=subprocess.PIPE) + helper.communicate(tb) + helper.wait() + def handleMyException((etype, value, tb)): """ |