From 6c2b89cd5c700c3f8060d5769b1788f25ce6aa2a Mon Sep 17 00:00:00 2001 From: Arefiev Anton Date: Mon, 11 Mar 2024 11:53:48 +0200 Subject: [PATCH] Clean up state VRRP PID file Change Id62bf18067d0b144c3e8825c7603cc1e51dca052 removes explicit PID files clean up for keepalived and brings regression as there is no 'process enable' for VRRP. Always delete stale PID file if exists Related-Bug: 1561046 Change-Id: I95a004a3acbe6a9160a19053a37fc0dd2b1875a5 (cherry picked from commit d3a8c9ca0f668cfefc271d7db01dbf0badbbecec) --- neutron/agent/linux/keepalived.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/neutron/agent/linux/keepalived.py b/neutron/agent/linux/keepalived.py index 5dfafdcdb0f..c29074605ef 100644 --- a/neutron/agent/linux/keepalived.py +++ b/neutron/agent/linux/keepalived.py @@ -27,6 +27,7 @@ from neutron._i18n import _ from neutron.agent.linux import external_process +from neutron.agent.linux import utils as linux_utils from neutron.cmd import runtime_checks as checks from neutron.common import utils @@ -504,8 +505,12 @@ def callback(pid_file): # will be orphan and prevent keepalived process to be spawned. # A check here will let the l3-agent to kill the orphan process # and spawn keepalived successfully. + # Also removes stale pid file if vrrp_pm.active: - vrrp_pm.disable() + vrrp_pm.disable(delete_pid_file=False) + + linux_utils.delete_if_exists(self.get_vrrp_pid_file_name(pid_file), + run_as_root=vrrp_pm.run_as_root) cmd = ['keepalived', '-P', '-f', config_path,