diff --git a/launcher b/launcher index 2d1d97e..232181c 100755 --- a/launcher +++ b/launcher @@ -134,7 +134,7 @@ bootstrap() { docker history $image >/dev/null 2>&1 || { show_progress "Pulling Seafile server image $version, this may take a while." docker pull $image - show_progress "Seafile server image $version pulled" + show_progress "Seafile server image $version pulled. Now bootstrapping the server ..." } # First initialize seafile server and letsencrypt diff --git a/scripts/bootstrap.py b/scripts/bootstrap.py index 2b822bc..e1e7c4e 100755 --- a/scripts/bootstrap.py +++ b/scripts/bootstrap.py @@ -41,7 +41,12 @@ def init_letsencrypt(): # Create a temporary nginx conf to start a server, which would accessed by letsencrypt render_template('/templates/seafile.nginx.conf.template', '/etc/nginx/sites-enabled/seafile.nginx.conf', context) + + # TODO: The 5 seconds heuristic is not good, how can we know for sure nginx is ready? + print 'waiting for mysql server to be ready' + time.sleep(5) call('nginx -s reload') + call('/scripts/ssl.sh {0} {1}'.format(ssl_dir, domain)) # if call('/scripts/ssl.sh {0} {1}'.format(ssl_dir, domain), check_call=False) != 0: # eprint('Now waiting 1000s for postmortem') diff --git a/scripts/start.py b/scripts/start.py index 4693cdf..fed22f5 100755 --- a/scripts/start.py +++ b/scripts/start.py @@ -40,7 +40,8 @@ def main(): json.dump(admin_pw, fp) while not exists('/var/run/mysqld/mysqld.sock'): - time.sleep(1) + print 'waiting for mysql server to be ready' + time.sleep(2) print 'mysql server is ready' try: