Univention Bugzilla – Bug 40894
enhance debugging of UMC module processes
Last modified: 2016-09-14 16:43:15 CEST
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.
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])
Part of svn r72411. *** This bug has been marked as a duplicate of bug 42114 ***