Skip to content

keepalived: Added track_script option to sync group and fixed print_track_script_indent#29027

Closed
rishabhshah2005 wants to merge 0 commit intoopenwrt:masterfrom
rishabhshah2005:master
Closed

keepalived: Added track_script option to sync group and fixed print_track_script_indent#29027
rishabhshah2005 wants to merge 0 commit intoopenwrt:masterfrom
rishabhshah2005:master

Conversation

@rishabhshah2005
Copy link
Copy Markdown

@rishabhshah2005 rishabhshah2005 commented Mar 30, 2026

📦 Package Details

Maintainer: @feckert
keepalived: Added track_script section to sync group and fixed print_track_script_indent

Description:

  1. Added track_script section to sync_group (only vrrp_script can be added)
  2. Fixed issue where track_script section was not being added in instance
  3. updated the config file and added some documentation

Build Test
Build tested successfully on a x86_64 device

✅ Formalities

  • I have reviewed the CONTRIBUTING.md file for detailed contributing guidelines.

@feckert
Copy link
Copy Markdown
Member

feckert commented Mar 31, 2026

  • Please use <= 60 chars per head line in the commit
  • Please use <= 75 chars per body line in the commit

Just have a look at the other commits in this repository – that’s a good place to start.

@feckert feckert requested review from Copilot and feckert March 31, 2026 05:48
@rishabhshah2005
Copy link
Copy Markdown
Author

rishabhshah2005 commented Mar 31, 2026

You want me to change commit messages in this PR itself?

@feckert
Copy link
Copy Markdown
Member

feckert commented Mar 31, 2026

You want me to change commit messages in this PR itself?

No. I mean in the commits. The commits get merged into the repository not the PR description.

@rishabhshah2005
Copy link
Copy Markdown
Author

rishabhshah2005 commented Mar 31, 2026

I meant the commit messages. How can I can I go back and change the messages. Sorry i am new to this and i have no idea how you guys would approach to do this

Edit: Never mind I did it. Are the changes acceptable now?

Copy link
Copy Markdown
Member

@feckert feckert left a comment

Choose a reason for hiding this comment

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

It’s always the first time 👍

There are my comments

Comment thread net/keepalived/files/keepalived.init Outdated
Comment thread net/keepalived/files/keepalived.init Outdated
procd_set_param respawn
procd_close_instance
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does not belongs to this change.
Either new commit or leave it as it is.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Cant this be accepted? Or should make changes in another commit to leave it as it is?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As I said. If this is not related to the change move it to a new commit.
I this case for example keepalived: remove empty line or in the other case keepalived: remove trailing whitespace

Comment thread net/keepalived/files/keepalived.config Outdated
Comment thread net/keepalived/files/keepalived.init Outdated
Comment thread net/keepalived/files/keepalived.init Outdated
Comment thread net/keepalived/files/keepalived.init Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the OpenWrt keepalived package integration to support generating track_script { ... } inside vrrp_sync_group blocks (using vrrp_script references), adjusts how track_script entries are rendered, and refreshes the example UCI config accordingly.

Changes:

  • Add track_script block generation to vrrp_sync_group.
  • Switch track_script lookups in instances/groups to use vrrp_script sections and extend vrrp_script emission with timeout.
  • Update example config and bump PKG_RELEASE.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
net/keepalived/Makefile Bumps package release to publish the integration changes.
net/keepalived/files/keepalived.init Adds sync-group track_script generation and changes track-script rendering / lookup logic.
net/keepalived/files/keepalived.config Updates example configuration/comments for the new track_script/vrrp_script behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread net/keepalived/files/keepalived.init
Comment thread net/keepalived/files/keepalived.config Outdated
Comment thread net/keepalived/files/keepalived.config Outdated
@rishabhshah2005 rishabhshah2005 requested a review from feckert April 6, 2026 10:05
Copy link
Copy Markdown
Member

@feckert feckert left a comment

Choose a reason for hiding this comment

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

Also you have not answered the question from copilot. If the comments are not correct, then please write your opinions and mark the comment as resolved.

@feckert
Copy link
Copy Markdown
Member

feckert commented Apr 18, 2026

Very good. The changes look good now.
However, so that I can merge them, you’ll need to rebuild the commits and structure them properly.
As it is now, I can’t merge them.

I’d would suggest to start with the API change by adding the indent.
And then adding the peer to its own section.
The last one should be the PGK_RELEASE bump.

@rishabhshah2005
Copy link
Copy Markdown
Author

I moved PGK_RELEASE bump at the end. Not quite sure what you mean by the other thing. If you mean the order, yes the adding of indent in config_section_open-close is first, followed by adding peer to its own section (this part was already there i just added the docs).

Copy link
Copy Markdown
Member

@feckert feckert left a comment

Choose a reason for hiding this comment

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

Sorry, I'm not happy with the way the patch is structured. I won't merge it like this. It's a right mess! Please close this PR and create a new one with your changes correct structed. Do only one thing in each commit, that is mention in the commits message.

Comment thread net/keepalived/files/keepalived.init Outdated
local name value weight direction
config_get name "$section" name
[ "$name" != "$curr_track_elem" ] && return 0
if [ -z "$name" ] && return 0
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The line if [ -n "$name" ] && return 0 is wrong and does not work.
It have to be [ -n "$name" ] && return 0.

config_get group "$1" group
[ -z "$group" ] && return 0

# Check if we have 'vrrp_instance's defined for
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As I said, this change doesn’t belong in this commit; it should be in a separate one. As it has nothing to do with the change.

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.

3 participants