Fix unwanted python exception in syslog during database container (#5227)
startup when doing redis PING since database_config.json getting generated from jinja2 template is still not ready. Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
This commit is contained in:
parent
570dbf52f6
commit
1a805e7409
@ -95,8 +95,13 @@ function postStartAction()
|
|||||||
link_namespace $DEV
|
link_namespace $DEV
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Wait until redis starts
|
# Wait until supervisord and redis starts. This change is needed
|
||||||
until [[ $($SONIC_DB_CLI PING | grep -c PONG) -gt 0 ]]; do
|
# because now database_config.json is jinja2 templated based
|
||||||
|
# and by the time file gets generated if we do redis ping
|
||||||
|
# then we catch python exception of file not valid
|
||||||
|
# that comes to syslog which is unwanted so wait till database
|
||||||
|
# config is ready and then ping
|
||||||
|
until [[ ($(docker exec -i database$DEV pgrep -x -c supervisord) -gt 0) && ($($SONIC_DB_CLI PING | grep -c PONG) -gt 0) ]]; do
|
||||||
sleep 1;
|
sleep 1;
|
||||||
done
|
done
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user