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

[hostcfgd] Get service enable/disable feature working #4676

Merged
merged 2 commits into from
Jun 2, 2020
Merged

[hostcfgd] Get service enable/disable feature working #4676

merged 2 commits into from
Jun 2, 2020

Conversation

jleveque
Copy link
Contributor

@jleveque jleveque commented May 31, 2020

Fix hostcfgd so that changes to the "FEATURE" table in ConfigDB are properly handled. Three changes here:

  1. Fix indenting such that the handling of each key actually occurs in the for key in status_data.keys(): loop
  2. Add calls to sudo systemctl mask and sudo systemctl unmask as appropriate to ensure changes persist across reboots
  3. Substitute returns with continues so that even if one service fails, we still try to handle the others

Note that the masking is persistent, even if the configuration is not saved. We may want to consider only calling systemctl enable/disable in hostcfgd when the DB table changes, and only call systemctl mask/unmask upon calling config save.

Copy link
Contributor

@prsunny prsunny left a comment

Choose a reason for hiding this comment

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

lgtm

@lguohan lguohan merged commit eff8a89 into sonic-net:master Jun 2, 2020
@jleveque jleveque deleted the use_systemctl_mask branch June 2, 2020 16:00
abdosi pushed a commit that referenced this pull request Jun 16, 2020
Fix hostcfgd so that changes to the "FEATURE" table in ConfigDB are properly handled. Three changes here:

1. Fix indenting such that the handling of each key actually occurs in the for key in status_data.keys(): loop
2. Add calls to sudo systemctl mask and sudo systemctl unmask as appropriate to ensure changes persist across reboots
3. Substitute returns with continues so that even if one service fails, we still try to handle the others

Note that the masking is persistent, even if the configuration is not saved. We may want to consider only calling systemctl enable/disable in hostcfgd when the DB table changes, and only call systemctl mask/unmask upon calling config save.
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.

4 participants