Univention Bugzilla – Bug 51683
Remove no-ldap evaluation from System Setup
Last modified: 2021-05-25 16:03:33 CEST
(In reply to Philipp Hahn from comment #5)
> (In reply to Florian Best from comment #4)
> > Is more cleanup necessary?
> > Removing the "no-ldap" evaluation? Is this another bug?
> Another bug as I lacked the deep understanding.
+++ This bug was initially created as a clone of Bug #33008 +++
ldap_available.sh was last called in UCS-3.0
testpipe = os.popen('/usr/lib/univention-system-setup/scripts/ldap_available.sh')
So after running setup-join.sh the file /var/run/univention-system-setup.ldap is created containing "no-ldap".
The file is not removed explicitly, but only after reboot by /lib/init/bootclean.sh.
Until then no LDAP objects are updated by calling UMC basic setup again.
It should probably be called once from umc/python/setup/util.py#run_scripts() just before calling the scripts.
It should also be rewritten in Python anyway, see attached patch.
(In reply to Florian Best from comment #1)
> /usr/lib/univention-system-setup/scripts/setup-join.sh contains:
> echo "no-ldap" > /var/run/univention-system-setup.ldap
> should this be changed to the script-call, too?
*** Bug 53156 has been marked as a duplicate of this bug. ***
The status file /var/run/univention-system-setup.ldap is now removed at the end of the system-setup run in /usr/lib/univention-system-setup/cleanup-post.d/06_remove_no_ldap_status_file.
[5.0-0 6a5977419d] Bug #51683: cleanup univention-system-setup.ldap status file
A DVD will automatically be built tonight. It can be used for the QA.
This looks more like a workaround than a actual solution?
Does it work for systems which have been upgraded from UCS 4.4 which still have that file?
Why not remove the whole "no-ldap" logic as suggested in the initial bug creation? We need to clone it otherwise again.
> 49 ldap_available=1
> 50 if [ "$(cat /var/run/univention-system-setup.ldap)" = "no-ldap" ]; then
> 51 » ldap_available=0
> 52 fi
→ At least the variable seems unused and can be removed.
* DVD builds.
* DVD-Install tests are successful.
* Manual test: installed and booted from fresh DVD: file /var/run/univention-system-setup.ldap was removed.
(In reply to Florian Best from comment #4)
> This looks more like a workaround than a actual solution?
It is the solution for the problem.
The problem being that during system-setup the LDAP gets purged and restarted a lot and thus some scripts should not write to it. To know that they shouldn't write to it even when it is running, an "information" must be available to them. That's this status file.
> Does it work for systems which have been upgraded from UCS 4.4 which still
> have that file?
They don't have that file anymore.
It was removed by /lib/init/bootclean.sh. (I don't know where that file can be found in our repositories.) You can just check your 4.4 systems.
But anyway: yes, it works for upgrades.
> Why not remove the whole "no-ldap" logic as suggested in the initial bug
> creation? We need to clone it otherwise again.
The initial bug report does not want to remove the logic. Its patch just moves the file removal code from /lib/init/bootclean.sh to util.py#run_scripts().
At the time the patch was written, the code in base/univention-system-setup/usr/lib/univention-system-setup/scripts/cleanup.py didn't yet exist. As it does now, this has become the place to go for cleanup code.
> > 49 ldap_available=1
> > 50 if [ "$(cat /var/run/univention-system-setup.ldap)" = "no-ldap" ]; then
> > 51 » ldap_available=0
> > 52 fi
> → At least the variable seems unused and can be removed.
[5.0-0 9755038865] Bug #51683: remove unused content from ldap status file
[5.0-0 0bee3d3d9a] Bug #51683: remove unused variable
What I tested:
DVD install -> OK
Appliance install -> OK
/var/run/univention-system-setup.ldap -> created on system configuration start -> OK
/var/run/univention-system-setup.ldap -> removed after configuration is complete -> OK
/var/run/univention-system-setup.ldap exits -> no ldap changes through the network module -> OK
/var/run/univention-system-setup.ldap doesn't exit -> ldap object is updated through the network module -> OK
jenkins -> OK
I added this bug to the changelog entry bug 33008.
[5.0-0 02257391a3] Bug #51683: changelog
/lib/init/bootclean.sh is part of the "initscripts" packages which isn't installed by default since 4.3, the /run directory should now be a tmpfs. The result is the same, a clean /run directory on each boot.
UCS 5.0 has been released:
If this error occurs again, please use "Clone This Bug".