Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[services] Ensure swss and syncd services start before dependent services #2634

Merged
merged 3 commits into from
Mar 2, 2019
Merged

[services] Ensure swss and syncd services start before dependent services #2634

merged 3 commits into from
Mar 2, 2019

Conversation

jleveque
Copy link
Contributor

@jleveque jleveque commented Mar 2, 2019

- What I did

  • Ensure swss and syncd services start before dependent services

- How I did it
With the previous solution, systemd would start dependent services simultaneously with swss and syncd. Due to the extra overhead in the swss.sh file, this would cause dependent containers (dhcp_relay, radv, etc.) to get started before swss.

Moving the /usr/local/bin/syncd.sh start call to ExecStartPre and moving the /usr/bin/syncd.sh attach from out of that script and assigning as the ExecStart command fixes this issue.

- How to verify it

Call systemctl restart swss and ensure containers stop and start in proper order as defined in systemd service files.

@jleveque jleveque self-assigned this Mar 2, 2019
@jleveque jleveque requested review from lguohan and yxieca March 2, 2019 00:37
Copy link
Contributor

@yxieca yxieca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@@ -13,7 +13,8 @@ Before=ntp-config.service
[Service]
User=root
Environment=sonic_asic_platform={{ sonic_asic_platform }}
ExecStart=/usr/local/bin/swss.sh start
ExecStartPre=/usr/local/bin/swss.sh start
ExecStart=/usr/local/bin/swss.sh attach
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use wait

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed offline that we should open a separate PR to change over to docker wait

Before=ntp-config.service

[Service]
User=root
Environment=sonic_asic_platform={{ sonic_asic_platform }}
ExecStart=/usr/local/bin/syncd.sh start
ExecStartPre=/usr/local/bin/syncd.sh start
ExecStart=/usr/local/bin/syncd.sh attach
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use wait

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed offline that we should open a separate PR to change over to docker wait

@lguohan lguohan merged commit 5eb7872 into sonic-net:master Mar 2, 2019
@jleveque jleveque deleted the fix_service_start_order branch March 4, 2019 18:48
@yxieca
Copy link
Contributor

yxieca commented Mar 7, 2019

Made to 201811 branch on 3/6/2019

yxieca pushed a commit that referenced this pull request Mar 7, 2019
…ices (#2634)

* [services] Ensure swss and syncd services start before dependent services

* Add 'attach' functions to scripts which get installed to /usr/local/bin so that services only reference the one script each

* Add 'After=swss.service' to syncd.service
tiantianlv pushed a commit to SONIC-DEV/sonic-buildimage that referenced this pull request Apr 10, 2019
…ices (sonic-net#2634)

* [services] Ensure swss and syncd services start before dependent services

* Add 'attach' functions to scripts which get installed to /usr/local/bin so that services only reference the one script each

* Add 'After=swss.service' to syncd.service
tiantianlv pushed a commit to SONIC-DEV/sonic-buildimage that referenced this pull request Apr 10, 2019
…ices (sonic-net#2634)

* [services] Ensure swss and syncd services start before dependent services

* Add 'attach' functions to scripts which get installed to /usr/local/bin so that services only reference the one script each

* Add 'After=swss.service' to syncd.service
tiantianlv pushed a commit to SONIC-DEV/sonic-buildimage that referenced this pull request Apr 10, 2019
…ices (sonic-net#2634)

* [services] Ensure swss and syncd services start before dependent services

* Add 'attach' functions to scripts which get installed to /usr/local/bin so that services only reference the one script each

* Add 'After=swss.service' to syncd.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants