From: Sage Weil Date: Wed, 9 Oct 2019 21:40:46 +0000 (-0500) Subject: ceph-daemon: explicitly wait for mon to start X-Git-Tag: v15.1.0~1201^2~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=97f522e20ef4b3c6de30e8b1eb8a016ba426227e;p=ceph-ci.git ceph-daemon: explicitly wait for mon to start All this does is make things easier to understand if there is a failure that prevents the mon from responding. Signed-off-by: Sage Weil --- diff --git a/src/ceph-daemon b/src/ceph-daemon index 6306f178b38..1579938c3d3 100755 --- a/src/ceph-daemon +++ b/src/ceph-daemon @@ -816,6 +816,26 @@ def command_bootstrap(): mon_c = get_container(fsid, 'mon', mon_id) deploy_daemon_units(fsid, 'mon', mon_id, mon_c) + logger.info('Waiting for mon to start...') + while True: + c = CephContainer( + image=args.image, + entrypoint='/usr/bin/ceph', + args=[ + '-n', 'mon.', + '-k', '/var/lib/ceph/mon/ceph-%s/keyring' % mon_id, + '-c', '/var/lib/ceph/mon/ceph-%s/config' % mon_id, + 'status'], + volume_mounts={ + mon_dir: '/var/lib/ceph/mon/ceph-%s:z' % (mon_id), + }, + ) + out, err, ret = call(c.run_cmd(), c.entrypoint) + if ret == 0: + break + logger.info('mon is still not available yet, waiting...') + time.sleep(1) + # assimilate and minimize config if not args.no_minimize_config: logger.info('Assimilating anything we can from ceph.conf...')