Skip to content

Conversation

@licliu
Copy link
Collaborator

@licliu licliu commented Nov 28, 2025

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.

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>
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @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, kdump-migrate-notify.service, to integrate the servicelog_notify mechanism for kdump migration events directly into the system boot process. This change aims to ensure consistent notification setup across various environments, particularly those where traditional package installation hooks might not suffice, by running the notification registration on every system startup. The commit provides only the unit file, with downstream packaging responsible for enabling it.

Highlights

  • New Systemd Service: Introduces a new systemd unit file, kdump-migrate-notify.service, to register kdump migration notifications using servicelog_notify.
  • Boot Process Integration: Ensures servicelog_notify runs on every system boot, providing proper setup for environments like bootc, unlike previous methods tied to package installation or upgrades.
  • Conditional Activation: The service is configured to activate only if the necessary executables, kdump-migrate-action.sh and servicelog_notify, are present on the system.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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
Copy link
Contributor

Choose a reason for hiding this comment

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

high

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
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

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

@licliu
Copy link
Collaborator Author

licliu commented Nov 28, 2025

Perhaps we could consider enabling it only on ostree-based systems by checking ConditionPathExists=/run/ostree-booted?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant