delay sm-api to provide service until sm starts

sm-api relys on sm service to provide service.
This change ensure sm-api start provide service after sm runtime
db is created.

Story: 2002988
Task: 23002

Change-Id: I3f1a970d5a5b8d7b77e6014008af39d36c55d6af
Signed-off-by: Bin Qian <bin.qian@windriver.com>
This commit is contained in:
Bin Qian 2018-07-09 09:19:12 -04:00
parent 045a37c672
commit 4fb1c66ab6
1 changed files with 4 additions and 3 deletions

View File

@ -63,10 +63,11 @@ def get_ipv6_server_cls():
def main():
# Parse config file and command line options, then start logging
# Periodically check every minute for want_sm_config
LOG = log.getLogger(__name__)
LOG.info("Wait for sm to start...")
# wait until sm start configuring before starting
while not os.path.exists("/var/run/sm/sm.db"):
time.sleep(5)
sm_api_service.prepare_service(sys.argv)