
When the mtcAgent locks a node, it commands the mtcClient to create a persistent .node_locked flag file at /etc/mtc/tmp/.node_locked. Conversely, when the node is unlocked, the mtcAgent commands the mtcClient to remove this flag file. However, an issue arises where an unlocked node may still have the .node_locked file present after an upgrade-rollback or patch-removal operation. The issue occurs because the OSTree upgrade deployment process runs while the node is locked. During this process, OSTree takes a snapshot of the /etc directory, which includes the .node_locked file. Even if the file is later removed by maintenance actions, after deploy but before reboot, OSTree restores it from the snapshot resulting in the reinstatement of the .node_locked file on an unlocked node. To eliminate this file management conflict, this update moves the persistent .node_locked flag file to a location outside of OSTree's management, specifically to /var/persist/mtc/.node_locked. The directory name 'persist' was chosen to clearly indicate that the files in this directory are intended to persist across reboots. This update also fixed a post install script logging error trying to rename the hwclock.sh.<init>.bak file with one already present. Test Plan: PASS: Verify the creation of the new /var/persist/mtc directory. PASS: Verify any files under this directory persist over reboot. PASS: Verify proper management of the node locked file over upgrade and rollback. PASS: Install a AIO DX and verify the node locked file management. PASS: Verify AIO DX upgrade from MR2PLUS to 24.09 master. PASS: Install a Standard DX System with 1 worker and 2 storage and verify the node locked file management over and following an upgrade from MR2PLUS to 24.09 master. PASS: Verify obsoleted /etc/mtc/tmp/.node_locked file is auto removed by both package install and over a mtcClient startup/restart. PASS: Verify /etc/mtc/tmp dir remains. PASS: Verify mtce debian package installs without error or warning. Closes-Bug: 2095212 Change-Id: I3431abfef74c678fbeaa149bf6ac29ee254be111 Signed-off-by: Eric MacDonald <eric.macdonald@windriver.com>
31 lines
1015 B
Bash
31 lines
1015 B
Bash
#!/bin/sh
|
|
set -e
|
|
|
|
#DEBHELPER#
|
|
|
|
case "$1" in
|
|
configure)
|
|
# Replace the default hwclock.sh with our copy
|
|
if [ -e /etc/init.d/hwclock.sh ]; then
|
|
if [ -e /etc/init.d/hwclock.sh.dpkg-bak ]; then
|
|
rm -f /etc/init.d/hwclock.sh.dpkg-bak
|
|
fi
|
|
mv -f /etc/init.d/hwclock.sh /etc/init.d/hwclock.sh.dpkg-bak
|
|
fi
|
|
cp -a /usr/share/mtce/hwclock.sh /etc/init.d/hwclock.sh
|
|
|
|
# Replace the default hwclock.service with our copy
|
|
if [ -e /lib/systemd/system/hwclock.service ]; then
|
|
if [ -e /lib/systemd/system/hwclock.service.bak ]; then
|
|
rm -f /lib/systemd/system/hwclock.service.bak
|
|
fi
|
|
mv -f /lib/systemd/system/hwclock.service /lib/systemd/system/hwclock.service.bak
|
|
fi
|
|
cp -a /usr/share/mtce/hwclock.service /lib/systemd/system/hwclock.service
|
|
;;
|
|
*)
|
|
echo "mtce postinst called with an unsupported argument \`$1'" >&2
|
|
exit 1
|
|
;;
|
|
esac
|