Files
update/devstack/lib/update
T
mmachado 196534120c Remove sw-patch-agent service
sw-patch-agent service would cause unwanted
reboots and conflicts with the USM patching strategy:

sw-patch-agent can interfere with software-agent and incorrectly
flag the host as reboot-required after noticing that it's not
patch-current by sw-patch standards

Logs will typically look like this before each reboot:

sw-patch-agent[2049]: patch_agent.py(390): INFO: Active Sysroot
Commit:650ace717b24afd2e7283cc6ce8b01f13adce84db95e03685610e120424610b9
does not match active controller's Feed Repo Commit:
028e1fa688afaa27aa7a34d4b5ee9eeb8d188b691ba3e558c409bb58e0e83fe2
sw-patch: Node has been patched, with reboot-required flag set.
Rebooting

Since sw-patch-agent is no longer needed, it's to be removed.

Depends-On: https://review.opendev.org/c/starlingx/stx-puppet/+/935555

Test-Plan:
PASS: AIO-SX upgrade using sw-manager strategy
PASS: AIO-DX System Controller upgrade using strategy
PASS: subcloud upgrade using dcmanager strategy
PASS: DC patch orchestration for n-1 subclouds

Story: 2010676
Task: 51387

Change-Id: I2af7dfab9da89eeba4ffef3fa0d884ae6f2c354f
Signed-off-by: mmachado <mmachado@windriver.com>
2024-11-25 15:05:33 +00:00

60 lines
1.7 KiB
Bash

#!/bin/bash
#
# lib/update
# ``stack.sh`` calls the entry points in this order:
#
# - install_update
# - configure_update
# - init_update
# - start_update
# - stop_update
# - cleanup_update
_XTRACE_STX_UPDATE=$(set +o | grep xtrace)
set -o xtrace
# Defaults
# --------
STXUPDATE_REPO=${STXUPDATE_REPO:-${GIT_BASE}/starlingx/update.git}
STXUPDATE_DIR=${GITDIR[$STX_UPDATE_NAME]}
STX_PATCH_DIR=$STXUPDATE_DIR/cgcs-patch
GITDIR["sw-patch"]=$STX_PATCH_DIR/cgcs-patch
# STX_INST_DIR should be a non-root-writable place to install build artifacts
STX_INST_DIR=${STX_INST_DIR:-/usr/local}
STX_BIN_DIR=${STX_BIN_DIR:-$STX_INST_DIR/bin}
STX_SBIN_DIR=${STX_SBIN_DIR:-$STX_INST_DIR/sbin}
# Set up so we don't use sudo for installs when not necessary
STX_SUDO="sudo"
[[ -w $STX_INST_DIR ]] && STX_SUDO="env"
PYTHON_SITE_DIR=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
function install_sw_patch {
setup_dev_lib "sw-patch"
local stx_patch_sbindir=$STX_SBIN_DIR
local stx_patch_sysconfdir=/etc/
$STX_SUDO install -m 755 -d ${stx_patch_sbindir}
$STX_SUDO install -m 755 -d ${stx_patch_sysconfdir}/bash_completion.d
$STX_SUDO install -m 755 -d ${stx_patch_sysconfdir}/goenabled.d
$STX_SUDO install -m 755 -d ${stx_patch_sysconfdir}/init.d
$STX_SUDO install -m 755 -d ${stx_patch_sysconfdir}/logrotate.d
$STX_SUDO install -m 755 -d ${stx_patch_sysconfdir}/patching
$STX_SUDO install -m 755 -d ${stx_patch_sysconfdir}/patching/patch-scripts
$STX_SUDO install -m 755 -d ${stx_patch_sysconfdir}/pmon.d
}
function install_update {
if is_service_enabled sw-patch; then
install_sw_patch
fi
}
$_XTRACE_STX_UPDATE