forked from sonoble/sonic-buildimage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge swss and syncd into single service (sonic-net#334)
Current implementation of swss and syncd causes a lot of problems in terms of dependencies and synchronization. Instead of handling them in separate services, we now start and stop them both as a single entity. Signed-off-by: marian-pritsak <marianp@mellanox.com>
- Loading branch information
1 parent
73fb59c
commit a877603
Showing
4 changed files
with
34 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,40 @@ | ||
[Unit] | ||
Description=switch state service container | ||
Description=switch state service | ||
Requires=database.service | ||
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 | ||
ExecStart=/usr/bin/{{docker_container_name}}.sh start | ||
|
||
{% if sonic_hwsku == 'ACS-MSN2700' %} | ||
ExecStartPre=/etc/init.d/sxdkernel start | ||
ExecStartPre=/usr/bin/mst start | ||
ExecStartPre=/etc/mlnx/msn2700 start | ||
{% elif sonic_hwsku == 'AS7512' %} | ||
ExecStartPre=-/etc/init.d/xpnet.sh stop | ||
ExecStartPre=/etc/init.d/xpnet.sh start | ||
{% endif %} | ||
|
||
# systemd allows only one parent process within service, | ||
# so we spawn both dockers from single bash parent | ||
ExecStart=/bin/bash -c "/usr/bin/{{docker_container_name}}.sh start & /usr/bin/syncd.sh start & wait -n 0" | ||
|
||
ExecStop=/usr/bin/{{docker_container_name}}.sh stop | ||
ExecStopPost=/usr/bin/syncd.sh stop | ||
|
||
{% if sonic_hwsku == 'ACS-MSN2700' %} | ||
ExecStopPost=/etc/mlnx/msn2700 stop | ||
ExecStopPost=/etc/init.d/sxdkernel stop | ||
ExecStopPost=/usr/bin/mst stop | ||
{% elif sonic_hwsku == 'AS7512' %} | ||
ExecStopPost=/etc/init.d/xpnet.sh stop | ||
ExecStopPost=/etc/init.d/xpnet.sh start | ||
{% endif %} | ||
|
||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters