Commit graph

32 commits

Author SHA1 Message Date
Florian Eckert
f9ed5a9f3a keepalived: add missing no_accept option
This commit adds the missing option 'no_accept'.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2023-10-30 14:09:36 +01:00
Florian Eckert
eb2ed20645 keepalived: add startup and shutdown script handling
The keepalived does support script call handling on start and stop.

All scripts located under '/etc/hotplug.d/keepalived' gets now called
with the env ACTION set to startup or shutdown. The script that want to
get called on this keepalived events could evalutate this env to run on
startup or shutdown.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2023-10-30 14:09:36 +01:00
Florian Eckert
09f20658d9 keepalived: add notify_up and notify_down for virtual server
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2023-10-04 17:01:04 +02:00
Florian Eckert
5462d06ba8 keepalived: add PING_CHECK to real_server
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2023-10-04 17:00:42 +02:00
Jaymin Patel
33398a38aa keepalived: high-availability files and data sync
add new package keepalived-sync to synchronize files and data
between master and backup node. The master node uses SSH over rsync
to send and the backup node will use inotifywatch to watch received files.

The master node can track rsync.sh script to send configuration file on
a backup node based on the vrrp_script configuration of the same script.

The backup node will have a keepalived-inotify service, which would watch
for newly received files and it would call hotplug event. Each service
can keep its respective script under the keepalived hotplug directory and
executes commands to stop, start service or update any config in real-time.

Whenever a switchover will happen, the backup node would have the latest
config and data files from the master node.

Hotplug events can be used to apply config when files are received.

Signed-off-by: Jaymin Patel <jem.patel@gmail.com>
2022-10-13 16:57:02 +05:30
Jaymin Patel
0f7415b8a8 keepalived: add status rpc and service improvement
- enable json by default to generate json stats
- add rpc to generate json status
- add kmod-nf-ipvs dependencies for virtual servers
- set default vip labels on virtual interfaces
- set process name for keepalived child processes

Signed-off-by: Jaymin Patel <jem.patel@gmail.com>
2022-09-15 17:08:11 +05:30
Francisco Jose Alvarez
f514bff2de keepalived: add uci support for track_bfd configuration
Allow the configuration of track_bfd for vrrp instance throught uci

Signed-off-by: Francisco Jose Alvarez <francisco.alvarez@galgus.net>
2022-04-28 18:11:30 +02:00
Florian Eckert
a8a1fbfa0d keepalived: fix config typo
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2020-06-15 11:47:33 +02:00
Florian Eckert
1b1ba71063 keepalived: add script security param to fix warning
Openwrt is a single user system. So keepalived is runnig as root.
If we add the config options `script_user root` and
`enabled_script_security' the following warnings are gone.

> local1.info Keepalived_vrrp[5382]: SECURITY VIOLATION - scripts are
being executed but script_security not enabled.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2020-05-04 09:07:00 +02:00
Florian Eckert
cc9e4d3b82 keepalived: move linkbeat_use_polling section into main section
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2020-05-04 09:07:00 +02:00
Florian Eckert
c4d1af42e8 keepalived: move alt_config_file check into process_config
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2020-05-04 09:07:00 +02:00
Florian Eckert
9b24763b9f keepalived: add upgrade script for globals section
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2020-05-04 09:07:00 +02:00
Florian Eckert
7a207f87af keepalived: fix shellcheck warnings
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2019-08-06 14:30:06 +02:00
Florian Eckert
344114ae81 keepalived: add new option vrrp_startup_delay
Redmine-patch-id: 3441
Add new global option vrrp_startup_delay to the uci.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2019-04-03 11:18:23 +02:00
Florian Eckert
b443dfe00b keepalived: add ipvs uci support
Add uci ipvs support to keepalived.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-11-12 15:20:20 +01:00
Florian Eckert
d5793b4917 net/keepalived: remove unsupported notify form print_notify statement
Remove unsupported "notify" script during uci config generation.
This change will remove keepalived warnings on startup.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-01-22 15:32:56 +01:00
Florian Eckert
0e88bff102 net/keepalived: add procd_add_reload_trigger
Do service reload handling by procd.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-01-22 15:32:56 +01:00
Florian Eckert
455d9a5b48 net/keepalived: change use_vmac to boolean
Append use_vmac with no_val_ so that the uci generation will treat this
as an boolean option. If the option is set then a interface with
vrrp.{virtual_router_id} is added to the system.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-01-22 15:32:56 +01:00
Florian Eckert
e518c65b58 net/keepalived: update keepalived.conf generation header
Add date info to keepalived config generated.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-01-22 15:32:56 +01:00
Florian Eckert
062c35f560 net/keepalived: on virtual IP allow empty device option
If ip is referenced in the instance section it is not necessary to add a
device option on every "ip_address". In most sitution it es enough to
add only an ip. Allow empty device option will solve this issue.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-01-22 15:32:56 +01:00
Florian Eckert
738da3146c net/keepalived: add keepalived.user script handling
Add keepalived.user script handling which are also saved during sysupgrade.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-11-08 11:36:58 +01:00
Florian Eckert
ff33ff463b net/keepalived: add notify hotplug-call script handling
During keepalived config generation for the vrrp_instance and vrrp_sync_group
the notify_* sections are automatic added to the runtime keepalived.conf.
This could be used for service which want to react on keepalived notifications.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-11-08 11:36:58 +01:00
Florian Eckert
4bd238e852 net/keepalived: comment alt_config_file
Comment alt_config_file option in default config

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-11-07 10:54:27 +01:00
Florian Eckert
d4e1c96cc4 net/keepalived: move track_interface generation into own section
In a vrrp_instance the track_interface could not be referenced similar
to a track_script. The uci track_interface section must be always set
into every vrrp_instance.

During config generation use the already prepared function
"print_track_elem_indent" to write the track_interface section into every
vrrp_instance which references this.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-10-30 15:40:25 +01:00
Florian Eckert
b66372fb43 net/keepalived: add quoting for print_elems_indent function
If you add a notify_* script which is not only a path to a script or
to a bin file, it is necessary to quote to whole string. If you do not
quote this the config will not get accepted by keepalived and so will
not start. This will fix this issue.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-10-30 15:40:25 +01:00
Alexandru Ardelean
f59f751e9a keepalived: use old keepalived.conf by default
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-01-04 20:46:53 +02:00
Ben Kelly
8483011a51 keepalived: suppress reloads when config md5 has no change
Signed-off-by: Ben Kelly <ben@benjii.net>
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2016-12-31 12:39:05 +02:00
Ben Kelly
0b16c2ada2 keepalived: Fix ordering of config sections
keepalived seems to be rather particular about which config parameters
come before others.

When defining a virtual IP address, keepalived will check to see if the
vrrp instance is associated with a valid interface. Previously, the
interface parameter was declared after the virtual IP address which
caused an error when keepalived tried to run this check. Keepalived
tries to fall back to checking if 'eth0' exists.

The fix is to re-order the config stanzas so that the interface
parameter comes before the virtual IP address definitions.

Signed-off-by: Ben Kelly <ben@benjii.net>
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2016-12-31 12:37:14 +02:00
Ben Kelly
37d9426ac5 keepalived: Fix track_* option in vrrp_instance defn
Also fix ordering of config stanzas

We were parsing the track_script and track_interface definitions to
include the weight param when configuring a vrrp_instance. This is not
correct, as the weight param inside a vrrp instance is used to augment
the one defined in the script.

We were also not taking into account vrrp_script stanzas

This commit skips the parsing and simply lists the name of the
track/vrrp object

Signed-off-by: Ben Kelly <ben@benjii.net>
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2016-12-31 12:31:40 +02:00
Alexandru Ardelean
a883235e13 keepalived: add uci config support
Adding @scrpi (Ben Kelly).
Initial UCI config support was written by me (@commodo)

Updates & fixes added by Ben.

Signed-off-by: Ben Kelly <ben@benjii.net>
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2016-12-31 12:15:54 +02:00
Alexandru Ardelean
e5c3d4433f keepalived: convert init script to procd format
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2016-12-31 12:15:22 +02:00
Nicolas Thill
460237b52e keepalived: import from old packages feed
- update to latest version (v1.2.15)
 - add license info
 - add myself as maintainer

Signed-off-by: Nicolas Thill <nico@openwrt.org>
2015-02-07 11:10:03 +01:00