From 6512e211c44832fae7d04684ac1820c0c28c8d0a Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 30 Apr 2024 14:26:10 +0200 Subject: [SS?S] Split static_files/system into base and updates base is considered static, i.e. only copied once when *installing* a server, because they are config files the user/admin is expected to edit, or because they have to match the specific Debian release the installed server is based on, and thus should not - or only selectively - be replaced by the satellite updater. In other words, the system-updates module should be save to be copied over a running satellite server on update via "install_files", while files from system-base will only be updated selectively, if at all. --- satellit_upgrader/updater.template.sh | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'satellit_upgrader/updater.template.sh') diff --git a/satellit_upgrader/updater.template.sh b/satellit_upgrader/updater.template.sh index 9ecbc88..3a0f3d2 100644 --- a/satellit_upgrader/updater.template.sh +++ b/satellit_upgrader/updater.template.sh @@ -171,7 +171,7 @@ install_files () { local SRC="$FILEDIR/$1" local files file ret [ -d "$SRC" ] || perror "NO SUCH DIRECTORY: $SRC" - readarray -t -d '' files < <( find "$SRC" -type f -print0 ) + readarray -t -d '' files < <( find "$SRC" \( -type f -o -type l \) -print0 ) ret=1 for file in "${files[@]}"; do diffcp "$1" "${file#$SRC}" && ret=0 @@ -378,8 +378,7 @@ failprint apt autoremove -y ## Enable unix socket passwordless local connection (commented out since default in Debian 9+ anyways) #mysql -e "UPDATE user SET plugin = 'unix_socket' WHERE Host = 'localhost' AND User = 'root'" -# Fix locale to C.UTF-8 for systemd -diffcp "system" "/etc/locale.conf" +install_files "system-updates" # ********************** Taskmanager *********************** # Do this first in case one of the later updates depends on the taskmanager @@ -853,7 +852,7 @@ if ! which tmate &> /dev/null && (( MAJOR >= 9 )); then fi if (( MAJOR >= 11 )); then # Fingerprints now need to be SHA256, maybe an old sat got dist-upgraded and still has MD5s in that file - diffcp "system" "/etc/tmux.conf" "Updating tmate config..." + diffcp "system-base" "/etc/tmux.conf" "Updating tmate config..." rm -f -- "/root/.tmate.conf" fi @@ -865,11 +864,7 @@ if ! [ -s /root/.ssh/id_rsa ]; then fi # Timesync -diffcp "system" "/usr/local/sbin/slx-wait-online" -diffcp "timesync" "/etc/systemd/system/redneck-timesync.service" -diffcp "timesync" "/usr/local/sbin/redneck-timesync.sh" -mkdir -p "/etc/systemd/system/network-online.target.wants" -ln -nfs "../redneck-timesync.service" "/etc/systemd/system/network-online.target.wants/redneck-timesync.service" +install_files "timesync" # Wait for webif callbacks and IPXE compile echo -n "Finishing." -- cgit v1.2.3-55-g7522