Keepalived setup - where to put config?

I'm a bit stumped as I'm trying to setup a couple of OpenWRT routers in high availability, I've installed the Keepalived package, I've written out my keepalived config files, I've copied them across onto the routers, and my config is obviously not loading.

I've replaced the conf in /etc/keepalived/keepalived.conf but when I start the service I can see from the logs that when keepalived is run is it loading the config from /tmp/keepalived.conf

If I try to change the config in /tmp/keepalived.conf it gets overwritten as soon as the service starts with a blank config.

I can't find any setup pages in the Luci interface to setup keepalived (nor any packages that add that functionality).

If I ssh onto the router and just run 'keepalived' then it loads my config from /etc/keepalived and works fine.

Obviously I can disable the init script, and just stick keepalived in the local startup file, but what am I missing? How am I supposed to setup Keepalived on OpenWRT?

I've read the docs on this several times forwards and backwards but can't seem to see anything different from what I'm doing - https://openwrt.org/docs/guide-user/network/high-availability

Thanks in advance!
Tim

Welcome :face_with_symbols_over_mouth:

Many openwrt services "morph" config into a final "runtime" config in /tmp. As per the documentation, your config is under /etc. If you change something under the correct /etc/ config file it should end up in the one under /tmp.... But you do not edit those files directly.

( disclaimer: I haven't actually run this yet on openwrt... but the docs indicate this is what you should be doing )

Edit: Looks like a "config" ( intermediate ) uci style set of settings might be available to you / now... and that could be "skipping" your static config file...

Try uncommenting the line in /etc/config/keepalive???;

config global_defs
#	option alt_config_file		"/etc/keepalived/keepalived.conf"

line... @bobafetthotmail updated the wiki last... so might know more about how many options you need to uncomment, when they were implemented... which is easier etc. etc.

Yep, taking out the # at the start of the line has done the trick - working as expected now.

Cheers

If the problem is solved, feel free to mark the topic accordingly.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.