From 0313cdacc2a8e1bf8aebfe08642c617f822ab4a7 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Fri, 16 May 2025 00:08:34 -0400 Subject: [PATCH] enable less service restarts to avoid nn bug --- fai/config/distro-install-common/bash-misc-funcs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/fai/config/distro-install-common/bash-misc-funcs b/fai/config/distro-install-common/bash-misc-funcs index af8a6af..60b35ba 100644 --- a/fai/config/distro-install-common/bash-misc-funcs +++ b/fai/config/distro-install-common/bash-misc-funcs @@ -26,7 +26,7 @@ # updates $reload to true if file updated is in /etc/systemd/system # u() { - local tmp tmpdir dest="$1" + local tmp tmpdir dest="$1" ser local base="${dest##*/}" local dir="${dest%/*}" if [[ $dir != "$base" ]]; then @@ -45,6 +45,15 @@ u() { if [[ $dest == /etc/systemd/system/* ]]; then # shellcheck disable=SC2034 # intentional reload=true + if declare -p modified_services &>/dev/null; then + ser=${dest#/etc/systemd/system/} + ser=${ser%%/*} + ser=%{ser%.d} + if [[ $ser == *.service || $ser == *.timer ]]; then + # shellcheck disable=SC2004 # seems false positive: this isnt arithmetic. + modified_services[$ser]=t + fi + fi fi fi rm -rf $tmpdir -- 2.30.2