Systemctl status for keepalive

Hi team,
i am using haproxy with keepalived but i wish to use keepalived script as systemctl status haproxy.service in my keepalived script.

Can you specify a little bit more? What do you exactly want to achieve? why the “standard” haproxy healthcheck is not ok for you?

actually i was using “killall -0 haproxy” as vrrp script. but it was not working properly and keepalived user getting permission errors so changed the script “systemctl status keepalived.service” which is working fine for me.

can i use this in keepalived script.


sorryt script cmd is " systemctl status haproxy.service ". not keepalived

haproxyslave Keepalived_vrrp[7910]: /usr/bin/killall -0 haproxy exited with status 1

haproxyslave Keepalived_vrrp[7910]: /usr/bin/killall -0 haproxy exited with status 1

this error getting in syslog.
that is why i am using systemctl status haproxy.service

you can use “pidof haproxy” instead of “killall -0 haproxy”.

I would better try to find out what is the problem with killall -0 haproxy or use pidof haproxy, I am not sure if you can have a situation where systemctl status haproxy.service gives you 0 return code but HAProxy is not running.