Move ldap initialization before the postinstall #1064
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The problem
Another poke for the "postinstall is too complex and lengthy". There's no necessity to run the LDAP initialization during the postinstall, and also it's complicated to properly reset and rerun the postinstall when it failed for some reason... Also initializing the LDAP database before postinstall opens up the ability to recommend people installing on arm boards to directly connect using the "admin" user instead of the confusing "root the first time but then admin user"
Solution
Init the ldap database during the .deb install
PR Status
Done, tested on my side
How to test
Theoretically it's just about running "dpkg-reconfigure yunohost" (after making sure that /etc/yunohost/installed doesnt exists yet) and running the postinstall.
But dpkg-reconfigure yunohost calls the installed .deb's postinst script ... but this PR changes it and it's not trivial to propagate it so uuuuh I just manually ran the various "bash /usr/share/.../... init" stuff that you can find in the changelog to simulate the "dpkg-reconfigure yunohost"