-
Notifications
You must be signed in to change notification settings - Fork 659
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
[multi-asic]: Update reload of systemd services to support multi-asic platforms #856
[multi-asic]: Update reload of systemd services to support multi-asic platforms #856
Conversation
to support multi-asic platforms.
config/main.py
Outdated
except SystemExit as e: | ||
log_error("Restart {} failed with error {}".format(service, e)) | ||
raise | ||
if ((service + '.service' in generated_services_list) or |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duplicated code as above. please use function to reduce the duplicated code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like the code is duplicated three times
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated code as per comment.
config/main.py
Outdated
except SystemExit as e: | ||
log_error("Stopping {} failed with error {}".format(service, e)) | ||
raise | ||
execute_systemctl(services_to_stop, SYSTEMCTL_STOP) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please check the return results and act accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
execute_systemctl() - this function prints error message or handles exception itself, should we further get return value and act?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as comments
services to ensure that the right instances are stopped and restarted if a service is both global and multi-instance.
f2959ca
… platforms (#856) * Update stop, reset failed status and restart of systemd services to support multi-asic platforms. * Create function to avoid code duplication. * Fixed errors due to pervious commit and review comments. * Minor update to fix spacing. * Minor update to fix spacing. * Minor update to fix spacing. * For multi asic platform updated logic of stopping/restarting of services to ensure that the right instances are stopped and restarted if a service is both global and multi-instance. * Fixed log error message with incorrect number of parameterts.
… platforms (sonic-net#856) * Update stop, reset failed status and restart of systemd services to support multi-asic platforms. * Create function to avoid code duplication. * Fixed errors due to pervious commit and review comments. * Minor update to fix spacing. * Minor update to fix spacing. * Minor update to fix spacing. * For multi asic platform updated logic of stopping/restarting of services to ensure that the right instances are stopped and restarted if a service is both global and multi-instance. * Fixed log error message with incorrect number of parameterts.
- What I did
For multi-asic platform, there can be multiple instances of some systemd services. currently config reload CLI stops and restarts only single instance of systemd service.
Modified stop/reset failed-status and restart system services function to perform action on multiple instances of systemd services.
- How I did it
- How to verify it
Bring up a single ASIC VS image.
Load config_db.json/minigraph.xml
Update config_db.json or load a new config_db.json.
Do a "config reload".
Verify that all required services are stopped and restarted.
Verify all services are up.
Verify if the configuration/interfaces of previous configuration is completely removed and new configuration is applied.
- Previous command output (if the output of a command-line utility has changed)
- New command output (if the output of a command-line utility has changed)