-
Notifications
You must be signed in to change notification settings - Fork 29
[script] use systemd service for otbr-agent restart workaround #131
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
base: main
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @yangsong-cnyn, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refactors the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request is a great improvement, replacing the legacy /etc/rc.local mechanism with a modern systemd service for the otbr-agent restart workaround. This makes the setup more robust and maintainable.
I have one suggestion to further improve the robustness of the new systemd service by adding a small delay, which should help ensure the workaround is effective even if the hardware takes a few moments to initialize.
Overall, this is a solid change.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
/gemini review |
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.
Code Review
This pull request modernizes the otbr-agent restart workaround by replacing a legacy /etc/rc.local modification with a dedicated systemd service. This is a significant improvement in terms of reliability and maintainability. My review includes a suggestion to further refine the systemd service unit by using more idiomatic directives, which enhances readability and adheres to systemd best practices. I also noted that the fixed-delay sleep could be made more robust, though the proposed change is already a good step forward.
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.
Code Review
This pull request is a great improvement, replacing an outdated and fragile rc.local modification with a modern and robust systemd service to handle the otbr-agent restart workaround. The new approach is more maintainable and reliable. I have one suggestion to further refine the systemd service unit file to make it more idiomatic.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
| grep -qxF 'sudo systemctl restart otbr-agent.service' /etc/rc.local || echo 'sudo systemctl restart otbr-agent.service' >>/etc/rc.local | ||
| echo 'exit 0' >>/etc/rc.local | ||
| # Restart otbr-agent as a workaround for nRF dongle not being ready. | ||
| cat <<EOF >/etc/systemd/system/otbr-agent-restart-workaround.service |
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.
I don't quite understand the root cause of that issue, and I don't see how this change would improve the reliability.
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.
the original comment is misleading: link_dongle.py is removed as ncs has fixed the USB filename issue.
the PR is 1. removing the misleading comment; 2. using systemd instead of rc
I have updated the PR description
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.
if the issue is already fixed, so we still need th restart workaround?
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.
I will test and confirm if removing restart otbr-agent is neccesaary
Deleted the original
# add calling of link_dongle.py script at startup to update symlink to the donglemisleading comment, as [ncs] bump submodules and update configs #18 has fixed the issue.This implementation creates a dedicated systemd service
otbr-agent-restart-workaround.servicethat runs once afterotbr-agent.servicehas started. This is a more robust and maintainable way to handle service dependencies and startup actions onsystemd-basedsystems.