Univention Bugzilla – Bug 48357
listener modules created with new listener API always displayed with status=0
Last modified: 2021-09-23 16:41:09 CEST
Created attachment 9779 [details]
simple listener module
When a listener module created with the new listener API is installed and the u-d-l is restarted the status shown with "univention-directory-listener-ctrl status" is always "0".
The listener did however successfully initialize the module, as can be seen in the logfile.
The status file in /var/lib/univention-directory-listener/handlers/$NAME does contain a "3", but "univention-directory-listener-ctrl status" still shows a "0".
Attached is a simple listener module to reproduce this.
<http://docs.software-univention.de/developer-reference-4.3.html#listener:handler> specified that "name" must be declared as the top-level symbol in the *Python* module.
This is parsed by the *shell* script "management/univention-directory-listener/src/listener-ctrl", which uses the regular expression
Using anything else breaks the status output.
I created a script that prints the configuration of both new and old API listener modules.
Because the old way is must faster (no Python import required), it is only used as a fall back.
[dtroeder/48357_listener_name 3b8a94241c] Bug #48357: get name of listener modules using new API
$ apt install pcre2-utils
$ pcre2grep -M -o3 "ListenerModuleHandler\).*(\n|.)*class Configuration.*(\n|.)*name\s*=\s*[\"'](.+)[\"']" <LISTENERMODULE>
This issue has been filed against UCS 4.3.
UCS 4.3 is out of maintenance and many UCS components have changed in later releases. Thus, this issue is now being closed.
If this issue still occurs in newer UCS versions, please use "Clone this bug" or reopen it and update the UCS version. In this case please provide detailed information on how this issue is affecting you.