summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2021-07-27 06:02:03 -0500
committerDaniil Baturin <daniil@vyos.io>2021-07-27 06:16:01 -0500
commit503bdbd444d993ddee0687e7ef5a51f3ad738b25 (patch)
tree792ed4284fbb3fec9cb87fc37af919b53a5e16e5
parent5a016d0e16533b593f252ce34be6f2e6ab83d2b6 (diff)
downloadvyos-1x-503bdbd444d993ddee0687e7ef5a51f3ad738b25.tar.gz
vyos-1x-503bdbd444d993ddee0687e7ef5a51f3ad738b25.zip
T3697: wait for charon to get started before trying to restart it.
-rwxr-xr-xsrc/conf_mode/ipsec-settings.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/conf_mode/ipsec-settings.py b/src/conf_mode/ipsec-settings.py
index a475ca14a..cbe4ba376 100755
--- a/src/conf_mode/ipsec-settings.py
+++ b/src/conf_mode/ipsec-settings.py
@@ -222,9 +222,14 @@ def restart_ipsec():
# Since it's started by the legacy ipsec.pl in VyOS 1.3,
# there's a chance that this script will run before charon is up,
# so we can't assume it's running and have to check and wait if needed.
+
+ # First, wait for charon to get started by the old ipsec.pl script.
+ wait_for_file_write_complete(charon_pidfile, timeout=120)
+
+ # Now actually restart the daemon
wait_for_file_write_complete(charon_pidfile,
pre_hook=(lambda: call('ipsec restart >&/dev/null')),
- timeout=10)
+ timeout=120)
# Force configuration load
call('swanctl -q >&/dev/null')