-
Notifications
You must be signed in to change notification settings - Fork 21
Add systemd service for servicelog_notify #128
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
This introduces a new systemd service for servicelog_notify to ensure proper setup during the actual boot process (e.g., for bootc environments). This commit only provides the unit file and has no immediate operational impact. Downstream packaging must configure the appropriate systemd preset and post-install script to enable it. Unlike the previous method, which only executed during kdump-utils installation or upgrades, via a systemd service will run servicelog_notify on every system boot. Signed-off-by: Lichen Liu <lichliu@redhat.com>
Summary of ChangesHello @licliu, 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 adds a new systemd unit file, 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 introduces a new systemd service, kdump-migrate-notify.service, to register a kdump migration notification on boot. The implementation is straightforward and generally follows systemd best practices. I have a couple of suggestions to improve the robustness of the service dependencies and the cleanup logic. Specifically, I recommend using BindsTo for a stronger link with kdump.service and making the ExecStop command more specific to prevent ambiguity. Overall, this is a good addition.
| Type=oneshot | ||
| RemainAfterExit=yes | ||
| ExecStart=/usr/bin/servicelog_notify --add --command=/usr/lib/kdump/kdump-migrate-action.sh --match='refcode="#MIGRATE" and serviceable=0' --type=EVENT --method=pairs_stdin | ||
| ExecStop=/usr/bin/servicelog_notify --remove --command=/usr/lib/kdump/kdump-migrate-action.sh |
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 ExecStop command might be too generic as it only specifies the --command to remove. If other notifications were registered with the same command but different match criteria, this could lead to ambiguity or incorrect removal. To ensure you are removing the exact notification added by ExecStart, it's safer to provide the same identifying parameters to the --remove command.
ExecStop=/usr/bin/servicelog_notify --remove --command=/usr/lib/kdump/kdump-migrate-action.sh --match='refcode="#MIGRATE" and serviceable=0' --type=EVENT --method=pairs_stdin
| @@ -0,0 +1,14 @@ | |||
| [Unit] | |||
| Description=Register kdump migration notification | |||
| After=kdump.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.
For a more robust dependency, consider using BindsTo=kdump.service instead of After=kdump.service. BindsTo implies After but also ensures that this service is stopped if kdump.service is stopped. This seems desirable since this service's purpose is tied to kdump, and it would trigger the ExecStop command to clean up the notification registration automatically when kdump is no longer active.
BindsTo=kdump.service
|
Perhaps we could consider enabling it only on ostree-based systems by checking |
This introduces a new systemd service for servicelog_notify to ensure proper setup during the actual boot process (e.g., for bootc environments).
This commit only provides the unit file and has no immediate operational impact. Downstream packaging must configure the appropriate systemd preset and post-install script to enable it.
Unlike the previous method, which only executed during kdump-utils installation or upgrades, via a systemd service will run servicelog_notify on every system boot.