keepalived icon indicating copy to clipboard operation
keepalived copied to clipboard

Weight and MASTER state is not changed when track_script script makes unavailable to run and critical healthchecked server service fails

Open Fikavec opened this issue 2 years ago • 0 comments

Describe the bug On my server, the healthcheck program was located on another server disk along with the other critial runtime data. Configuration of vrrp_script looks like:

vrrp_script healthcheck_logic {
    script "/non_system_mount_point_sdb2/data/healthcheck"
	user nobody
	interval 10
	timeout 60
	weight 50
	rise 2
	fall 3
	init_fail 
}

When the disk failed, server OS stays alive, but vrrp_script script and checked by him critial runtime data makes unavailable - keepalived did not change the weight or MASTER state. In log file:

Keepalived_vrrp[3410]: Error exec-ing command '/non_system_mount_point_sdb2/data/healthcheck', error 2: No such file or directory

In notify.c (used in _vrrp_script struct) i'm found that keepalived when can't run script (126, 127 states and other system errors) always returning exit(0) - as if everything is fine (with comment in code /* Script errors aren't server errors */ ), but nothing is not fine when early working healthcheck program or script becomes unrunable. This is not server error, but in my case server OS with keepalived still running, but critical working service and healthcheck program fails and this server is not lowered weight and switched to BACKUP state as it should be. After manual server rebooting in log:

Keepalived_vrrp[701]: Script /non_system_mount_point_sdb2/data/healthcheck cannot be accessed - No such file or directory
Keepalived_vrrp[701]: Disabling track script healthcheck_logic since not found/accessible

What is disabling track script when i'm using init_fail setting (thanks to #468) - my server rebooted, OS fine, but critical working service still fail and healthcheck script is disabled and keepalived don't knewn is healthchecked service fine and wanna became MASTER?

Please add settings to don't disabling track script and don't ignore any problems in track script with vrrp_script healthcheck script (setting to activating script returning exit(1) by default if any (and unknown) problems with healthcheck) and still working with configurated vrrp_script logic (+-weight if fail as describing in vrrp_script configuration section).

Fikavec avatar Apr 18 '22 20:04 Fikavec