Systemctl status for keepalive


#1

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


#2

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


#3

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.

thanks
prasanth


#4

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


#5

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


#6

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


#7

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.