summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-02-07 21:52:49 +0100
committerGitHub <noreply@github.com>2024-02-07 21:52:49 +0100
commit4a897e5ee0364ada5fda48e684592d7e43cbad99 (patch)
tree39e87f4fb1b98a1d68029ac94c4ae5ff7be9fe96
parentc9d7a7cabc1236e97687718f37ee63bc4428e410 (diff)
parent9b8e11e078c42e3ae86ebfa45fec57336f25a0af (diff)
downloadvyos-1x-4a897e5ee0364ada5fda48e684592d7e43cbad99.tar.gz
vyos-1x-4a897e5ee0364ada5fda48e684592d7e43cbad99.zip
Merge pull request #2959 from c-po/init-T2044-rpki-part-2
init: T2044: only start rpki if cache is configured
-rw-r--r--python/vyos/utils/config.py9
-rwxr-xr-xsrc/init/vyos-router6
2 files changed, 11 insertions, 4 deletions
diff --git a/python/vyos/utils/config.py b/python/vyos/utils/config.py
index bd363ce46..33047010b 100644
--- a/python/vyos/utils/config.py
+++ b/python/vyos/utils/config.py
@@ -1,4 +1,4 @@
-# Copyright 2023 VyOS maintainers and contributors <maintainers@vyos.io>
+# Copyright 2023-2024 VyOS maintainers and contributors <maintainers@vyos.io>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -31,4 +31,9 @@ def read_saved_value(path: list):
if not ct.exists(path):
return ''
res = ct.return_values(path)
- return res[0] if len(res) == 1 else res
+ if len(res) == 1:
+ return res[0]
+ res = ct.list_nodes(path)
+ if len(res) == 1:
+ return ' '.join(res)
+ return res
diff --git a/src/init/vyos-router b/src/init/vyos-router
index ac1cf249e..2b4fac5ef 100755
--- a/src/init/vyos-router
+++ b/src/init/vyos-router
@@ -448,14 +448,16 @@ start ()
restore_if_missing_postconfig_script
run_postconfig_scripts
- vtysh -c "rpki start"
+ tmp=$(${vyos_libexec_dir}/read-saved-value.py --path "protocols rpki cache")
+ if [ ! -z $tmp ]; then
+ vtysh -c "rpki start"
+ fi
}
stop()
{
local -i status=0
log_daemon_msg "Stopping VyOS router"
- vtysh -c "rpki stop"
for ((i=${#sub_inits[@]} - 1; i >= 0; i--)) ; do
s=${subinit[$i]}
log_progress_msg $s