Bug 40894 - enhance debugging of UMC module processes
enhance debugging of UMC module processes
Status: RESOLVED DUPLICATE of bug 42114
Product: UCS
Classification: Unclassified
Component: UMC (Generic)
UCS 4.1
Other Linux
: P5 normal (vote)
: UCS 4.1-x
Assigned To: UMC maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-03-14 09:28 CET by Florian Best
Modified: 2016-09-14 16:43 CEST (History)
0 users

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Troubleshooting
Max CVSS v3 score:
best: Patch_Available+


Attachments
patch (2.83 KB, patch)
2016-03-14 09:28 CET, Florian Best
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2016-03-14 09:28:07 CET
Created attachment 7532 [details]
patch

It is not easy to debug a UMC module process. This can be enhanced by being able to start one in foreground and make it possible to specify /dev/stderr as logfile.
The attached patch does this by adding a option -f/--foreground.
Comment 1 Florian Best univentionstaff 2016-03-14 10:00:32 CET
The patch is really nice because it allows to really debug any exception with pdb. Just monkeypatch some more little code (like beneath), start "univention-management-console-server -n -d4 -L /dev/stdout" and wait for any exception:

diff --git a/management/univention-management-console/src/univention/management/console/base.py b/management/univention-management-console/src/univention/management/console/base.py
index d8cc821..bbea72e 100644
--- a/management/univention-management-console/src/univention/management/console/base.py
+++ b/management/univention-management-console/src/univention/management/console/base.py
@@ -285,6 +285,7 @@ def execute(self, method, request):
                        self.finished(request.id, None, _('The UMC service is currently shutting down or restarting. Please retry soon.'), status=503)
                        raise
                except:
+                       import pdb; pdb.post_mortem()
                        self.__error_handling(request, method, *sys.exc_info())
 
        def thread_finished_callback(self, thread, result, request):
diff --git a/management/univention-management-console/src/univention/management/console/protocol/session.py b/management/univention-management-console/src/univention/management/console/protocol/session.py
index 91ae6c7..3c75948 100644
--- a/management/univention-management-console/src/univention/management/console/protocol/session.py
+++ b/management/univention-management-console/src/univention/management/console/protocol/session.py
@@ -151,6 +151,8 @@ def __init__(self, module, debug='0', locale=None):
                # determine locale settings
                modxmllist = moduleManager[module]
                args = [MODULE_COMMAND, '-m', module, '-s', socket, '-d', str(debug)]
+               if module == 'appcenter':
+                       args.extend(['-f', '-L' , '/dev/stdout'])
                for modxml in modxmllist:
                        if modxml.notifier:
                                args.extend(['-n', modxml.notifier])
Comment 2 Florian Best univentionstaff 2016-09-14 16:43:15 CEST
Part of svn r72411.

*** This bug has been marked as a duplicate of bug 42114 ***