Skip to content

Commit 6c2b89c

Browse files
Arefiev Antonbrianphaley
authored andcommitted
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 d3a8c9c)
1 parent 51e19bb commit 6c2b89c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

neutron/agent/linux/keepalived.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
from neutron._i18n import _
2929
from neutron.agent.linux import external_process
30+
from neutron.agent.linux import utils as linux_utils
3031
from neutron.cmd import runtime_checks as checks
3132
from neutron.common import utils
3233

@@ -504,8 +505,12 @@ def callback(pid_file):
504505
# will be orphan and prevent keepalived process to be spawned.
505506
# A check here will let the l3-agent to kill the orphan process
506507
# and spawn keepalived successfully.
508+
# Also removes stale pid file
507509
if vrrp_pm.active:
508-
vrrp_pm.disable()
510+
vrrp_pm.disable(delete_pid_file=False)
511+
512+
linux_utils.delete_if_exists(self.get_vrrp_pid_file_name(pid_file),
513+
run_as_root=vrrp_pm.run_as_root)
509514

510515
cmd = ['keepalived', '-P',
511516
'-f', config_path,

0 commit comments

Comments
 (0)