From: Ian Kelling Date: Fri, 16 May 2025 04:08:34 +0000 (-0400) Subject: enable less service restarts to avoid nn bug X-Git-Url: https://iankelling.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;p=automated-distro-installer enable less service restarts to avoid nn bug --- 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