Keepalived not working properly on OpenWrt 25.12.0

Perhaps this is a legacy issue. After installing Keepalived on OpenWrt 25.12.0 and completing the configuration, keepalived still cannot start. Here is my keepalived configuration:

And here is the vrrp status after I have saved and applied the configuration:

I tried to restart the keepalived service using the command service keepalived start/stop/restart on the command line, but it still doesn't work:

Checking the system logs, I can't even see any keepalived-related content:

OK, I think I have found the issue. In the configuration file /etc/init.d/keepalived, I found this logic check that mandates the existence of /etc/config/keepalived and requires the configuration item globals.enabled to be set to 1; otherwise, it directly returns 0 and does not start:

Upon checking, I found that the uci configuration file /etc/config/keepalived does exist, but the value of the configuration item globals.enabled is 0:

image

However, in the LuCI configuration interface for keepalived, there is no configuration item for enabled:

Perhaps this is why globals.enabled always remains 0, consequently preventing keepalived from starting!

Now I changed the value of globals.enabled in the configuration file /etc/config/keepalived to 1,save and exit:

image

then restarted the keepalived service, and it is now working properly:

image

I wonder, is it necessary to optimize this logic?

You got it. This is pretty normal behaviour for an proc init script.

/etc/init.d/keepalived enable will autostart the service.

Enter /etc/init.d/keepalived and you should get a list of init script options.

1 Like

Pushed out some UI fixes for those. I never use it, though.

I was hardly surprised to even find keepalived support in uci a few month ago. Kinda like it!

1 Like