Univention Bugzilla – Bug 47940
Support join hooks in univention-join
Last modified: 2019-03-12 13:41:13 CET
univention-join should support * pre-join * pre-joiscripts * post-joinscripts hooks.
branch school/joinhooks
Implementation: * univention-join-hooks has been added, looks for settings/code with specified hooktype and runs the hook code * new helper run_join_hook in joinscripthelper.lib * univention-join * run_join_hook pre-join - before computer account creation * run_join_hook pre-joinscripts - before joinscripts * run_join_hook post-joinscripts - after joinscripts * univention-run-join-scripts * run_join_hook pre-joinscripts - before running join scripts * run_join_hook post-joinscript - safter running joinscripts Hooks can (and will be) be executed multiple times (univention-run-join-scripts) and therefore have to be idempotent.
We have to ignore the hooks in appbox!
We need a test for this.
The new feature is already merged into 4.4-0 (Bug #47957). So at this bug we only need to * ignore the join hooks in appbox * add a test for this
(In reply to Felix Botner from comment #5) > So at this bug we only need to > * ignore the join hooks in appbox Just to be sure: I think, this should be part of the join hooks itself, so we are still able to call join hooks within docker appbox images.
(In reply to Sönke Schwardt-Krummrich from comment #6) > (In reply to Felix Botner from comment #5) > > So at this bug we only need to > > * ignore the join hooks in appbox > > Just to be sure: I think, this should be part of the join hooks itself, so > we are still able to call join hooks within docker appbox images. Yes, that makes sense, so on thins bug only one last task * add a test for join hooks
(In reply to Felix Botner from comment #0) > * pre-joiscripts > * post-joinscripts Can we rename these hook types to "pre-joinscript" and "post-joinscript" (singular not plural)? This would improve the clarity since the settings/data object contains only ONE script and not several.
(In reply to Sönke Schwardt-Krummrich from comment #8) > (In reply to Felix Botner from comment #0) > > * pre-joiscripts > > * post-joinscripts > > Can we rename these hook types to "pre-joinscript" and "post-joinscript" > (singular not plural)? > This would improve the clarity since the settings/data object contains only > ONE script and not several. as discussed, i changed the join hooks to * join/pre-join * join/pre-joinscripts * join/post-joinscripts and added some debug output to univention-join-hooks added tests/11_join/15join_hooks to ucs-test
univention-join does not show any progress/message if the join hooks are called. Depending on the hook, this may take some time. Maybe we should print something like "Calling join hooks", and "done" before/after univention-join-hooks is called. output on stdout: root@slave152:~# univention-join univention-join: joins a computer to an ucs domain copyright (c) 2001-2019 Univention GmbH, Germany Enter DC Master Account : Administrator Enter DC Master Password: Search DC Master: done Check DC Master: done Stop LDAP Server: done Search ldap/base done Start LDAP Server: done Search LDAP binddn done Sync time: done Join Computer Account: done Sync ldap-backup.secret: done Check TLS connection: done Download host certificate: done Restart LDAP Server: done Sync Kerberos settings: done Create kerberos/adminserver File: /etc/krb5.conf ←←←←←←←←←←← here the hook is called Configure 01univention-ldap-server-init.inst done Configure 03univention-directory-listener.inst done Configure 04univention-ldap-client.inst done Configure 05univention-bind.inst done Configure 08univention-apache.inst done Configure 10univention-ldap-server.inst done
added Running pre/post-joinscripts hook(s): done to univention-join and univention-run-join-scripts f82b4711f9edcba39d1e0e75c98ea336229e45e7 - univention-join 610393132ea7555443052e86ca5e91e6c87b1dbb - changelog
I fixed a minor thing: the last commit wrote the current package version and copyright year into the file, instead of the @%@copyright_year@%@ etc. 89a71e921c | fix minor collateral commit damage Package: univention-join Version: 11.0.1-13A~4.4.0.201902252035 Branch: ucs_4.4-0
Ok: * Code review * Test cases * Changelog
UCS 4.4 has been released: https://docs.software-univention.de/release-notes-4.4-0-en.html https://docs.software-univention.de/release-notes-4.4-0-de.html If this error occurs again, please use "Clone This Bug".