From faad39d454139cba8f2ad5b438399a4d0ab67bcc Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Tue, 6 Oct 2020 19:48:25 +0000 Subject: [PATCH] systemvm: fix keepalived is always restarted when update config for monitor service in 4.15, keepalievd in redundant VRs keeps restarting every minute. After debugging, I found it happens when update config for monitor service. it is because keepalived process is changed in Debian 10. in Debian 9 (systemvm for 4.14), ``` root@r-1969-VM:~# ps -ef|grep keepalived root 16324 1 0 09:53 ? 00:00:04 /usr/sbin/keepalived root 16325 16324 0 09:53 ? 00:00:04 /usr/sbin/keepalived root 16326 16324 0 09:53 ? 00:00:14 /usr/sbin/keepalived ``` in Debian 10 (systemvm for 4.15), processes end with "--dont-fork" ``` root@r-2040-VM:~# ps -ef|grep keepalived root 5237 1 0 16:40 ? 00:00:00 /usr/sbin/keepalived --dont-fork root 5239 5237 0 16:40 ? 00:00:03 /usr/sbin/keepalived --dont-fork ``` --- systemvm/debian/opt/cloud/bin/cs/CsRedundant.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/systemvm/debian/opt/cloud/bin/cs/CsRedundant.py b/systemvm/debian/opt/cloud/bin/cs/CsRedundant.py index cefedbfe84f1..24748efba3d6 100755 --- a/systemvm/debian/opt/cloud/bin/cs/CsRedundant.py +++ b/systemvm/debian/opt/cloud/bin/cs/CsRedundant.py @@ -194,7 +194,7 @@ def _redundant_on(self): heartbeat_cron.commit() proc = CsProcess(['/usr/sbin/keepalived']) - if not proc.find(): + if proc.grep("/usr/sbin/keepalived") == -1: force_keepalived_restart = True if keepalived_conf.is_changed() or force_keepalived_restart: keepalived_conf.commit()