Skip to content

Commit

Permalink
[fix] wait for slapd to finish reloading after a regen-conf, this fix…
Browse files Browse the repository at this point in the history
… install on slow hardware/vps
  • Loading branch information
Psycojoker committed Aug 8, 2016
1 parent 21376eb commit 8d698f7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions data/hooks/conf_regen/06-slapd
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,18 @@ do_post_regen() {
fi

sudo service slapd force-reload

# force waiting of slapd service restart otherwise this will break all other
# yunohost process that needs the admin user, like the regen_conf hooks that
# will occurs after this one
# wait a maximum time of 5 minutes
# yes, force-reload behave like a restart
number_of_wait=0
while [[ ! "$(pgrep slapd)" ]] && ((number_of_wait < 60))
do
sleep 5
((number_of_wait += 1))
done
}

FORCE=${2:-0}
Expand Down

0 comments on commit 8d698f7

Please sign in to comment.