[hostcfgd] Get service enable/disable feature working #4676
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix hostcfgd so that changes to the "FEATURE" table in ConfigDB are properly handled. Three changes here:
for key in status_data.keys():
loopsudo systemctl mask
andsudo systemctl unmask
as appropriate to ensure changes persist across rebootsreturn
s withcontinue
s so that even if one service fails, we still try to handle the othersNote 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 callsystemctl mask/unmask
upon callingconfig save
.