Univention Bugzilla – Bug 45460
[OX] create listener queue print tool
Last modified: 2017-11-17 13:06:02 CET
The OX listener queue causes regularly problems. For the support and customers it is difficult to safely handle the queue files found in /var/spool/univention-directory-listener/ox-*. It is especially difficult to handle them selectively and not all at once. Create a script that prints the current content of the ox listener queue: type (user/group) | name (uid/cn) | operation (add/mod/del) | filename | DN The script should be shipped somewhere below /usr/share/
The tool should also contain an interactive mode, that allows archiving/removing some queue items.
We need this tool badly to reduce overhead in support.
r82794: add interactive queue management tool The dependency "python-pick" (https://github.com/wong2/pick), for a simple ncurses selection list, was added as a binary package (with sources) to ucs_4.2-0-ucs-school-4.2/{all,source} Package: univention-ox Version: 9.0.5-2A~4.2.0.201710172148 Branch: ucs_4.2-0 Scope: oxse4ucs
Add non-interactive features: * --help * --archive : backup files found (optionally filter list) * --delete : delete files found (optionally filter list) * --list : print list to stdout: type|name|operation|filename|DN * --filter $DN : optional filter for all other operations * --filenames-only : option to use together with --list: only print a space separated list of filenames (to use with a pipe)
usage: manage_listener_queue [-h] [--archive] [--delete] [--list] [--filter FILTER] [--wide] [--filenames-only] Manage the OX listener queue optional arguments: -h, --help show this help message and exit --archive Move queue files to /var/spool/univention-directory- listener_backup. --delete Delete queue files. --list Print a list of queue files and related information. --filter FILTER Optional regular expression to limit actions to only those DNs that match (interactive and non-interactive), e.g. 'uid=alice,' or '^cn=.*,ou=myschool,'. Use single tick quoting to prevent shell expansion. --wide Also show the DN (very long lines). --filenames-only Option to use together with "--list": print a space separated list of filenames, no description. An interactive mode will be started, when no action (archive/delete/list) is chosen. --------------- --filter and --wide work in both (interactive and non-interactive) modes. r82807: readd interactive queue management tool with non-interactive mode r82808: update advisory
(In reply to Daniel Tröder from comment #5) > r82807: readd interactive queue management tool with non-interactive mode This commit was not sufficient. An entry in debian/univention-ox.install was missing → fixed it univention-ox (9.0.6-8): c1b7e4782ab8 | Bug #45460: install manage_listener_queue to /usr/share/univention-ox/ Package: univention-ox Version: 9.0.6-8A~4.2.0.201711161439 Branch: ucs_4.2-0 Scope: oxse4ucs root@oxmaster97:/usr/share/univention-ox# ./manage_listener_queue Traceback (most recent call last): File "./manage_listener_queue", line 264, in <module> sys.exit(main()) File "./manage_listener_queue", line 218, in main handler.collect_pickle_files() File "./manage_listener_queue", line 129, in collect_pickle_files for filename in [f for f in os.listdir(queue_path) if f != 'lock.tmp']: OSError: [Errno 2] No such file or directory: '/var/spool/univention-directory-listener/ox-resource' → REOPEN, the tool should handle missing directories without tracebacks Otherwise everything seems to be ok.
> → REOPEN, the tool should handle missing directories without tracebacks Suggestion: --- a/univention-ox/share/manage_listener_queue +++ b/univention-ox/share/manage_listener_queue @@ -126,6 +126,8 @@ class OXQueueFilesHandling(object): def collect_pickle_files(self): for ox_module, queue_path in self.queue_paths.items(): + if not os.path.isdir(queue_path): + continue for filename in [f for f in os.listdir(queue_path) if f != 'lock.tmp']: path = os.path.join(queue_path, filename) try:
Committed patch of last comment: 9d8ccd057734 | Bug #45460: add changelog entry 3c01818868c3 | Bug #45460: add small fix for missing queue directories Package: univention-ox Version: 9.0.6-11A~4.2.0.201711162154 Branch: ucs_4.2-0 Scope: oxse4ucs univention-ox (9.0.6-11):
Does no longer trace if a queue directory is missing. OK: code change OK: functional test OK: advisory
OX App Suite 7.8.4-ucs8 has been released. If this error occurs again, please clone this bug.