Fix bug: if all containers killed, service stop will throw exception because no redis (#2139)
Signed-off-by: Qi Luo <qiluo-msft@users.noreply.github.com>
This commit is contained in:
parent
cd1167d767
commit
7d51f8363f
@ -39,6 +39,7 @@ function postStartAction()
|
|||||||
{%- endif %}
|
{%- endif %}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
start() {
|
||||||
# Obtain our platform as we will mount directories with these names in each docker
|
# Obtain our platform as we will mount directories with these names in each docker
|
||||||
PLATFORM=`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`
|
PLATFORM=`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`
|
||||||
|
|
||||||
@ -50,7 +51,6 @@ HWSKU=""
|
|||||||
HWSKU=`sonic-cfggen -d -v 'DEVICE_METADATA["localhost"]["hwsku"]'`
|
HWSKU=`sonic-cfggen -d -v 'DEVICE_METADATA["localhost"]["hwsku"]'`
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
start() {
|
|
||||||
DOCKERCHECK=`docker inspect --type container {{docker_container_name}} 2>/dev/null`
|
DOCKERCHECK=`docker inspect --type container {{docker_container_name}} 2>/dev/null`
|
||||||
if [ "$?" -eq "0" ]; then
|
if [ "$?" -eq "0" ]; then
|
||||||
DOCKERMOUNT=`getMountPoint "$DOCKERCHECK"`
|
DOCKERMOUNT=`getMountPoint "$DOCKERCHECK"`
|
||||||
|
Reference in New Issue
Block a user