Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions kdump-migrate-notify.service
Original file line number Diff line number Diff line change
@@ -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

ConditionPathExists=/usr/lib/kdump/kdump-migrate-action.sh
ConditionPathExists=/usr/bin/servicelog_notify

[Service]
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


[Install]
WantedBy=multi-user.target
Loading