Skip to content

Commit

Permalink
[swss]: Wait for redis server start before database clean (#281)
Browse files Browse the repository at this point in the history
picked this change from sonic-mgmt repo.

sonic-net/sonic-mgmt#110
  • Loading branch information
lguohan authored Feb 9, 2017
1 parent 064dab6 commit e5616f2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions files/build_templates/swss.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ After=database.service

[Service]
User={{ sonicadmin_user }}
# Wait for redis server start before database clean
ExecStartPre=/bin/bash -c "while true; do if [ \"$(/usr/bin/docker exec database redis-cli ping)\" == \"PONG\" ]; then break; fi; sleep 1; done"
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
Expand Down

0 comments on commit e5616f2

Please sign in to comment.