Bug 23324 - "Entwicklung von Univention Directory Listener-Modulen" should document modrdn
"Entwicklung von Univention Directory Listener-Modulen" should document modrdn
Status: RESOLVED FIXED
Product: Z_wiki.univention.de
Classification: Unclassified
Component: ZZZ - Trash - Developer information
unspecified
Other Linux
: P5 normal
: UCS 3.0-2
Assigned To: Philipp Hahn
:
: 25642 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-08-16 15:05 CEST by Janek Walkenhorst
Modified: 2012-07-18 17:47 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 Janek Walkenhorst univentionstaff 2011-08-16 15:05:09 CEST
The modrdn/handler(dn, new, old, command) API for Listener modules should be documented.
Comment 1 Janek Walkenhorst univentionstaff 2011-08-16 15:09:03 CEST
Wenn man auf Modulebene
 modrdn = '1'
setzt, dann lautet die neue Definition von handler so:
 def handler(dn, new, old, command):

Der Wert von command spiegelt die Aktion die gemacht wurde wieder:
'm' → Objekt normal modifiziert ("new and old")
'd' → Objekt gelöscht ("not new and old")
'r'+'a' → Objekt umbenannt (erst wird handler mit command='r' und "not new and old" aufgerufen, dann wird Handler mit command='a' und "new and not old" aufgerufen.
Comment 2 Janek Walkenhorst univentionstaff 2011-08-16 17:30:31 CEST
setdata sollte auch dokumentiert werden.
Comment 3 Sönke Schwardt-Krummrich univentionstaff 2012-05-23 11:57:37 CEST
*** Bug 25642 has been marked as a duplicate of this bug. ***
Comment 4 Philipp Hahn univentionstaff 2012-05-31 13:05:34 CEST
(In reply to comment #1)
> Wenn man auf Modulebene
>  modrdn = '1'

Das muß unbedingt eine Zeichenkette sein (Bug #27376). Inhalt ist egal, die Existenz reicht. 

> setzt, dann lautet die neue Definition von handler so:
>  def handler(dn, new, old, command):
> 
> Der Wert von command spiegelt die Aktion die gemacht wurde wieder:
> 'm' → Objekt normal modifiziert ("new and old")
> 'd' → Objekt gelöscht ("not new and old")
> 'r'+'a' → Objekt umbenannt (erst wird handler mit command='r' und "not new and
> old" aufgerufen, dann wird Handler mit command='a' und "new and not old"
> aufgerufen.

'd' = "changetype: delete"
'm' = "changetype: modify"
'r' = "changetype: modrdn"
'a' = "changetype: add" → Objekt wurde hinzugefügt ("new and not old")
'z' → "else"-Fall bzg. changetype <univention-directory-notifier/src/notify.c:723>

(In reply to comment #2)
> setdata sollte auch dokumentiert werden.

setdata(key, value) wird beim Starten des Listeners nach dem importieren der Module mehrmals (4×) aufgerufen, um einige Kommandozeilenparameter an die Module durchzureichen:
  key="basedn", value="Basis-DN, «-b»"
  key="binddn", value="Simple-Bind-DN, «-D»"
  key="bindpw", value="Bind-Passwort, «-y»"
  key="ldapserver", value="Festgelegter bzw. automatisch gewählter LDAP-Server, «-h» oder «ldap/master» auf DC_Backup oder «ldap/backup» auf DC_*"
Comment 5 Philipp Hahn univentionstaff 2012-05-31 16:21:27 CEST
Weiter im Kleingedruckten:

(In reply to comment #4)
> (In reply to comment #1)
> > setzt, dann lautet die neue Definition von handler so:
> >  def handler(dn, new, old, command):
> > 
> > Der Wert von command spiegelt die Aktion die gemacht wurde wieder:
> > 'm' → Objekt normal modifiziert ("new and old")
> > 'd' → Objekt gelöscht ("not new and old")
> > 'r'+'a' → Objekt umbenannt (erst wird handler mit command='r' und "not new and
> > old" aufgerufen, dann wird Handler mit command='a' und "new and not old"
> > aufgerufen.
> 
> 'd' = "changetype: delete"
> 'm' = "changetype: modify"
> 'r' = "changetype: modrdn"
> 'a' = "changetype: add" → Objekt wurde hinzugefügt ("new and not old")
> 'z' → "else"-Fall bzg. changetype
> <univention-directory-notifier/src/notify.c:723>

'n' = Schema-Änderung (dn="cn=Subschema") <src/change.c:121>, <src/change.c:364>
'n' = Bei der Initialisierung eines Moduls für alle zutreffenden Objekte ??? <src/change.c:196>


Der Listener erhält das Kommando von Notifier, der sie wiederum aus /var/lib/univention-ldap/listener/listener liest. Diese Datei wird je nach Systemrolle unterschiedlich befüllt:
- DC_Master: hier schreibt das tanslog-Overlay im slapd die Änderungen <openldap/**/10_translog_overlay.patch#servers/slapd/overlays/translog.c>
- DC_Backup: hier leitet der Listener die Daten weiter <univention-directory-listener/src/transfile.c>
- DC_Slave: wie bei Backup ???
Comment 6 Philipp Hahn univentionstaff 2012-07-18 17:47:12 CEST
Im Rahmen von Bug #26725 in <http://wiki.univention.de/index.php?title=Entwicklung_von_Univention_Directory_Listener-Modulen> integriert.

Ich habe absichtlich nicht alle Werte bzgl. command aufgeführt, da das eher verwirrt.