summaryrefslogtreecommitdiff
path: root/src/conf_mode/system-ip.py
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-09-15 21:20:29 +0200
committerGitHub <noreply@github.com>2023-09-15 21:20:29 +0200
commit41341f776cefded63ed5a3f64f6d301ca0715b94 (patch)
treed55d22403ee57dba42bab23a09ceeb3c86d2a411 /src/conf_mode/system-ip.py
parent768df77b078a0d699961d57f163e8b20c7f488bd (diff)
parentcc6b26f6dffbda26820c5a5ff4ed7016629bb33d (diff)
downloadvyos-1x-41341f776cefded63ed5a3f64f6d301ca0715b94.tar.gz
vyos-1x-41341f776cefded63ed5a3f64f6d301ca0715b94.zip
Merge pull request #2266 from vyos/mergify/bp/sagitta/pr-2255
T5575: ARP/NDP table-size isnt set properly (backport #2255)
Diffstat (limited to 'src/conf_mode/system-ip.py')
-rwxr-xr-xsrc/conf_mode/system-ip.py28
1 files changed, 17 insertions, 11 deletions
diff --git a/src/conf_mode/system-ip.py b/src/conf_mode/system-ip.py
index 5e4e5ec28..7612e2c0d 100755
--- a/src/conf_mode/system-ip.py
+++ b/src/conf_mode/system-ip.py
@@ -20,10 +20,12 @@ from vyos.config import Config
from vyos.configdict import dict_merge
from vyos.configverify import verify_route_map
from vyos.template import render_to_string
-from vyos.utils.process import call
from vyos.utils.dict import dict_search
from vyos.utils.file import write_file
+from vyos.utils.process import call
+from vyos.utils.process import is_systemd_service_active
from vyos.utils.system import sysctl_write
+
from vyos import ConfigError
from vyos import frr
from vyos import airbag
@@ -115,16 +117,20 @@ def apply(opt):
value = '48' if (tmp is None) else tmp
sysctl_write('net.ipv4.tcp_mtu_probe_floor', value)
- zebra_daemon = 'zebra'
- # Save original configuration prior to starting any commit actions
- frr_cfg = frr.FRRConfig()
-
- # The route-map used for the FIB (zebra) is part of the zebra daemon
- frr_cfg.load_configuration(zebra_daemon)
- frr_cfg.modify_section(r'ip protocol \w+ route-map [-a-zA-Z0-9.]+', stop_pattern='(\s|!)')
- if 'frr_zebra_config' in opt:
- frr_cfg.add_before(frr.default_add_before, opt['frr_zebra_config'])
- frr_cfg.commit_configuration(zebra_daemon)
+ # During startup of vyos-router that brings up FRR, the service is not yet
+ # running when this script is called first. Skip this part and wait for initial
+ # commit of the configuration to trigger this statement
+ if is_systemd_service_active('frr.service'):
+ zebra_daemon = 'zebra'
+ # Save original configuration prior to starting any commit actions
+ frr_cfg = frr.FRRConfig()
+
+ # The route-map used for the FIB (zebra) is part of the zebra daemon
+ frr_cfg.load_configuration(zebra_daemon)
+ frr_cfg.modify_section(r'ip protocol \w+ route-map [-a-zA-Z0-9.]+', stop_pattern='(\s|!)')
+ if 'frr_zebra_config' in opt:
+ frr_cfg.add_before(frr.default_add_before, opt['frr_zebra_config'])
+ frr_cfg.commit_configuration(zebra_daemon)
if __name__ == '__main__':
try: