Skip to content

Commit

Permalink
Fix bug: if all containers killed, service stop will throw exception …
Browse files Browse the repository at this point in the history
…because no redis (#2139)

Signed-off-by: Qi Luo <qiluo-msft@users.noreply.github.com>
  • Loading branch information
qiluo-msft authored and lguohan committed Oct 12, 2018
1 parent cd1167d commit 7d51f83
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions files/build_templates/docker_image_ctl.j2
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,18 @@ function postStartAction()
{%- endif %}
}

# Obtain our platform as we will mount directories with these names in each docker
PLATFORM=`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`
start() {
# Obtain our platform as we will mount directories with these names in each docker
PLATFORM=`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`

{%- if docker_container_name == "database" %}
# Don't mount HWSKU in {{docker_container_name}} container.
HWSKU=""
{%- else %}
# Obtain our HWSKU as we will mount directories with these names in each docker
HWSKU=`sonic-cfggen -d -v 'DEVICE_METADATA["localhost"]["hwsku"]'`
{%- endif %}
{%- if docker_container_name == "database" %}
# Don't mount HWSKU in {{docker_container_name}} container.
HWSKU=""
{%- else %}
# Obtain our HWSKU as we will mount directories with these names in each docker
HWSKU=`sonic-cfggen -d -v 'DEVICE_METADATA["localhost"]["hwsku"]'`
{%- endif %}

start() {
DOCKERCHECK=`docker inspect --type container {{docker_container_name}} 2>/dev/null`
if [ "$?" -eq "0" ]; then
DOCKERMOUNT=`getMountPoint "$DOCKERCHECK"`
Expand Down

0 comments on commit 7d51f83

Please sign in to comment.