From 2412fff39cbd28b6eafca1f0113f002060c6e633 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Thu, 25 Apr 2024 17:19:36 +0200 Subject: [PATCH] confd: ensure correct ownership of startup-config after factory reset Fixes #415 Signed-off-by: Joachim Wiberg --- package/confd/confd.conf | 3 ++- src/confd/bin/bootstrap | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package/confd/confd.conf b/package/confd/confd.conf index f961896c..36eaf683 100644 --- a/package/confd/confd.conf +++ b/package/confd/confd.conf @@ -10,10 +10,11 @@ run name:error :1 log:console norestart if: \ service name:confd log \ [S12345] sysrepo-plugind -f -p /run/confd.pid -n -- Configuration daemon -# Bootstrap system with startup-config +# Bootstrap system with startup-config, ensure correct ownership run name:startup log:prio:user.notice norestart \ [S] /usr/libexec/confd/load startup-config \ -- Loading startup-config +task chown admin:wheel /cfg/startup-config.cfg -- # Run if loading startup-config fails for some reason run name:failure log:prio:user.critical norestart if: \ diff --git a/src/confd/bin/bootstrap b/src/confd/bin/bootstrap index 5f6931bf..7e0fe87b 100755 --- a/src/confd/bin/bootstrap +++ b/src/confd/bin/bootstrap @@ -255,7 +255,6 @@ chgrp wheel /cfg chmod g+w /cfg if [ ! -f "$STARTUP_CFG" ]; then sysrepocfg -f json -X"$STARTUP_CFG" - chown admin:wheel "$STARTUP_CFG" fi # Clear running-config so we can load startup in the next step