Run track_scripts as root

Damien Clabaut <[email protected]> Tue, 20 Feb 2018 20:01:15 +0000
Newsgroups gmane.linux.keepalived.devel
Message-ID <[email protected]>
Hello,
I am having an issue with a track_scripts that needs to be run as root.

I have the following config:
global_defs {
  script_user root root
  enable_script_security
}
vrrp_script check_oco {
    
    script "/scripts/vrrp_oco_healthcheck.sh 300"
    interval 10
    timeout 5
    weight -100
    fall 2
    rise 2
    user root root
}

The script and it's folder are accessible only by root:
[root@hz-3b-vr /] ll
drwx------   2 root root  4096 Feb 20 20:40 scripts

[root@hz-3b-vr /scripts] ll
-rwx------ 1 root root  991 Feb 20 18:22 vrrp_oco_healthcheck.sh

When I launch the script manually it returns a 0:
[root@hz-3b-vr /] /scripts/vrrp_oco_healthcheck.sh 300; echo $?
0

However, when launched by Keepalived, supposedly as root, it fails:
Feb 20 20:53:01 hz-3b-vr Keepalived_vrrp[32791]: Script `check_oco` now returning 1
Feb 20 20:53:01 hz-3b-vr Keepalived_vrrp[32791]: VRRP_Script(check_oco) failed (exited with status 1)

I don't see any way to get more logs for this issue, how could I do this ?

Regards,
-- 
Damien Clabaut
R&D vRouter
OVH
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot