mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[fix] wait for admin user to be available after a slapd regen-conf, this fix install on slow hardware/vps
This commit is contained in:
parent
21376eb956
commit
9a66a00278
1 changed files with 17 additions and 0 deletions
|
@ -102,6 +102,23 @@ do_post_regen() {
|
|||
fi
|
||||
|
||||
sudo service slapd force-reload
|
||||
|
||||
# on slow hardware/vm this regen conf would exit before the admin user that
|
||||
# is stored in ldap is available because ldap seems to slow to restart
|
||||
# so we'll wait either until we are able to log as admin or until a timeout
|
||||
# is reached
|
||||
# we need to do this because the next hooks executed after this one during
|
||||
# postinstall requires to run as admin thus breaking postinstall on slow
|
||||
# hardware which mean yunohost can't be correctly installed on those hardware
|
||||
# and this sucks
|
||||
# wait a maximum time of 5 minutes
|
||||
# yes, force-reload behave like a restart
|
||||
number_of_wait=0
|
||||
while ! sudo su admin -c '' && ((number_of_wait < 60))
|
||||
do
|
||||
sleep 5
|
||||
((number_of_wait += 1))
|
||||
done
|
||||
}
|
||||
|
||||
FORCE=${2:-0}
|
||||
|
|
Loading…
Add table
Reference in a new issue