From 7a547cc3ff5031c0992d587f76e7ccfda53b6771 Mon Sep 17 00:00:00 2001 From: Oleksandr Ivantsiv Date: Fri, 3 Feb 2017 16:26:27 +0200 Subject: [PATCH 1/2] Add FLUSH DB commands to swss service missed during merge --- files/build_templates/swss.service.j2 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/files/build_templates/swss.service.j2 b/files/build_templates/swss.service.j2 index 3e7eb7cb68da..b43644de93ee 100644 --- a/files/build_templates/swss.service.j2 +++ b/files/build_templates/swss.service.j2 @@ -1,10 +1,13 @@ [Unit] -Description=orchagent container +Description=switch state service container Requires=database.service After=database.service [Service] User={{ sonicadmin_user }} +/usr/bin/docker exec database redis-cli -n 0 FLUSHDB +/usr/bin/docker exec database redis-cli -n 1 FLUSHDB +/usr/bin/docker exec database redis-cli -n 2 FLUSHDB ExecStart=/usr/bin/{{docker_container_name}}.sh start ExecStop=/usr/bin/{{docker_container_name}}.sh stop ExecStopPost=/usr/bin/syncd.sh stop From 54a5756b09a49a3a8428b46c1567fa3cfc220adf Mon Sep 17 00:00:00 2001 From: Oleksandr Ivantsiv Date: Fri, 3 Feb 2017 18:11:19 +0200 Subject: [PATCH 2/2] Update swss.service.j2 --- files/build_templates/swss.service.j2 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/files/build_templates/swss.service.j2 b/files/build_templates/swss.service.j2 index b43644de93ee..b7e34335f5fe 100644 --- a/files/build_templates/swss.service.j2 +++ b/files/build_templates/swss.service.j2 @@ -5,9 +5,9 @@ After=database.service [Service] User={{ sonicadmin_user }} -/usr/bin/docker exec database redis-cli -n 0 FLUSHDB -/usr/bin/docker exec database redis-cli -n 1 FLUSHDB -/usr/bin/docker exec database redis-cli -n 2 FLUSHDB +ExecStartPre=/usr/bin/docker exec database redis-cli -n 0 FLUSHDB +ExecStartPre=/usr/bin/docker exec database redis-cli -n 1 FLUSHDB +ExecStartPre=/usr/bin/docker exec database redis-cli -n 2 FLUSHDB ExecStart=/usr/bin/{{docker_container_name}}.sh start ExecStop=/usr/bin/{{docker_container_name}}.sh stop ExecStopPost=/usr/bin/syncd.sh stop