Bug 34826 - CLI tools should deactivate univention-directory-notifier during import
CLI tools should deactivate univention-directory-notifier during import
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: Import scripts
UCS@school 3.2 R2
Other Linux
: P5 normal (vote)
: UCS@school 3.2 R2
Assigned To: Sönke Schwardt-Krummrich
Florian Best
:
: 34876 (view as bug list)
Depends on: 34825
Blocks:
  Show dependency treegraph
 
Reported: 2014-05-13 21:10 CEST by Sönke Schwardt-Krummrich
Modified: 2014-06-12 09:20 CEST (History)
2 users (show)

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):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sönke Schwardt-Krummrich univentionstaff 2014-05-13 21:10:46 CEST
This change should also be done for the CLI tools.

+++ This bug was initially created as a clone of Bug #34825 +++

To prevent problems with the sync between LDAP and S4, the CSV-Import should deactivate univention-directory-notifier during import.
Comment 1 Dirk Wiesenthal univentionstaff 2014-05-14 23:34:12 CEST
Used

with stopped_notifier():
  "main()"

so that it is done for every function (import_user, import_computer, but also export_computer). Stops and restarts the notifier even when the function is not really called but just

parser.print_help()
sys.exit(1)

after initial argument checks. Done it this way to not miss anything, while stopping the notifier for some time is safe as far as I understand it, even when it has been unnecessary.

Only errors are logged.
Comment 2 Sönke Schwardt-Krummrich univentionstaff 2014-05-15 15:43:18 CEST
The notifier is restarted if the notifier was running before.
The ucs-test script seem to be unimpressed by the change (not all tests have run through, but keep on going).

Starting any CLI command takes now up to 5 seconds before any output is shown on the command line. Seems to be ok for now.
Comment 3 Sönke Schwardt-Krummrich univentionstaff 2014-05-15 15:53:31 CEST
Changelog entry has been added.
Comment 4 Sönke Schwardt-Krummrich univentionstaff 2014-05-20 14:18:16 CEST
It shows that the waiting time is too long. The notifier should be stopped after parsing the command line arguments. The CLI tools should also print a progress message. E.g.

Stopping Univention Directory Notifier...
Univention Directory Notifier stopped.
[...CLI tool output...]
Starting Univention Directory Notifier...
Univention Directory Notifier started.
Comment 5 Sönke Schwardt-Krummrich univentionstaff 2014-05-20 14:18:36 CEST
*** Bug 34876 has been marked as a duplicate of this bug. ***
Comment 6 Sönke Schwardt-Krummrich univentionstaff 2014-05-20 21:57:22 CEST
(In reply to Sönke Schwardt-Krummrich from comment #4)
> It shows that the waiting time is too long. The notifier should be stopped
> after parsing the command line arguments. 

This change was much bigger than the original one.

> The CLI tools should also print a progress message. E.g.
>
> Stopping Univention Directory Notifier...
> Univention Directory Notifier stopped.
> [...CLI tool output...]
> Starting Univention Directory Notifier...
> Univention Directory Notifier started.

Improved stopped_notifier() in ucs-school-lib.

ucs-school-lib (5.0.39-1) unstable; urgency=low
ucs-school-import (10.0.18-1) unstable; urgency=low
Comment 7 Dirk Wiesenthal univentionstaff 2014-05-21 01:03:34 CEST
(In reply to Sönke Schwardt-Krummrich from comment #6)
> Improved stopped_notifier() in ucs-school-lib.

Partly reverted. Improved add_stream_logger_to_schoollib() instead
Comment 8 Florian Best univentionstaff 2014-05-21 08:40:37 CEST
OK, UDN is stopped while the script runs and outputs log messages.
Changelog OK
Comment 9 Sönke Schwardt-Krummrich univentionstaff 2014-06-12 09:19:31 CEST
UCS@school 3.2 R2 has been released:
http://docs.univention.de/release-notes-ucsschool-3.2R2-de.html

If this error occurs again, please use "Clone This Bug".