Subcloud install failing due to non-existing directory (/etc/pmon.d)

Debian sub cloud is failing to bootstrap at the "Register kubelet
with pmond" task due to a non-existing directory, /etc/pmon.d.

This change ensures that the directory /etc/pmon.d exists, and that
the required files for different traits are appropriately linked.

TEST PLAN:

PASS: Verify that /etc/pmon.d is created on the subcloud when
      deploying the subcloud

PASS: Verify that the "Register kublet with pmond" ansible task
      completes

Closes-Bug: 1991968

Signed-off-by: Shrikumar Sharma <shrikumar.sharma@windriver.com>
Change-Id: I6d71fad61bd0fa3a58cc1ab4f2d33fb7a7ec1bc7
This commit is contained in:
Shrikumar Sharma 2022-10-06 16:26:59 +00:00
parent f644aa29b0
commit 2dbe96cd1a
1 changed files with 71 additions and 19 deletions

View File

@ -836,14 +836,14 @@ export lowlatency=false
export aio=false
for trait in ${traits//,/ }; do
# dlog "trait:${trait}"
case ${trait} in
"controller") controller=true ;;
"storage") storage=true ;;
"worker") worker=true ;;
"lowlatency") lowlatency=true ;;
*) wlog "unknown trait '${trait}'" ;;
esac
# dlog "trait:${trait}"
case ${trait} in
"controller") controller=true ;;
"storage") storage=true ;;
"worker") worker=true ;;
"lowlatency") lowlatency=true ;;
*) wlog "unknown trait '${trait}'" ;;
esac
done
# Force enable 'lowlatency' trait if the realtime kernel is detected ; PREEMPT_RT
@ -920,11 +920,11 @@ function check_execs()
{
missing_exec=0
for x in ${REQUIRED_EXECS} ; do
which ${x} > /dev/null 2>&1
if [ ${?} -ne 0 ] ; then
elog "dependency check failed ; required '${x}' exec is missing"
missing_exec=1
fi
which ${x} > /dev/null 2>&1
if [ ${?} -ne 0 ] ; then
elog "dependency check failed ; required '${x}' exec is missing"
missing_exec=1
fi
done
return ${missing_exec}
}
@ -1016,10 +1016,10 @@ done
# Log info about system state at beginning of partitioning operation
for dev in $STOR_DEVS; do
ilog "Initial partition table for $dev is:"
# log "Initial partition table for $dev is:"
parted -s $dev unit mib print
# parted -s $dev unit mib print >> ${LOGFILE}
ilog "Initial partition table for $dev is:"
# log "Initial partition table for $dev is:"
parted -s $dev unit mib print
# parted -s $dev unit mib print >> ${LOGFILE}
done
display_volume_info "before"
@ -1091,7 +1091,7 @@ part_type_flags_str="Attribute flags"
if [ "$(curl -sf http://pxecontroller:6385/v1/upgrade/$(hostname)/in_upgrade 2>/dev/null)" = "true" ]; then
# In an upgrade, only wipe the disk with the rootfs and boot partition
# In an upgrade, only wipe the disk with the rootfs and boot partition
wlog "In upgrade, wiping only ${INSTDEV}"
WIPE_HDD=${INSTDEV}
ONLYUSE_HDD="$(basename ${INSTDEV})"
@ -1899,7 +1899,7 @@ rm /etc/hostname
# If using a serial install make sure to add a getty on the tty1
conarg=`cat /proc/cmdline |xargs -n1 echo |grep console= |grep ttyS`
if [ -n "$conarg" ] ; then
echo "1:2345:respawn:/sbin/mingetty tty1" >> /etc/inittab
echo "1:2345:respawn:/sbin/mingetty tty1" >> /etc/inittab
fi
blkid >> ${LOGFILE}
@ -2325,5 +2325,57 @@ fi
chmod 700 ${IMAGE_ROOTFS}/etc/goenabled.d/config_goenabled_check.sh
if [[ ! -d "${IMAGE_ROOTFS}/etc/pmon.d" ]]; then
wlog "Directory /etc/pmon.d/ is missing, creating it now"
mkdir ${IMAGE_ROOTFS}/etc/pmon.d
fi
if [ "${controller}" = true ] ; then
ilog "Setting up pmon files for ${TRAIT__CONTROLLER} and/or ${TRAIT__CONTROLLER} side of ${SYSTEM_TYPE__AIO}"
ln -s /usr/share/starlingx/pmon.d/acpid.conf ${IMAGE_ROOTFS}/etc/pmon.d/acpid.conf
ln -s /usr/share/starlingx/pmon.d/containerd.conf ${IMAGE_ROOTFS}/etc/pmon.d/containerd.conf
ln -s /usr/share/starlingx/pmon.d/docker.conf ${IMAGE_ROOTFS}/etc/pmon.d/docker.conf
ln -s /usr/share/starlingx/pmon.d/fm-api.conf ${IMAGE_ROOTFS}/etc/pmon.d/fm-api.conf
ln -s /usr/share/starlingx/pmon.d/fsmon.conf ${IMAGE_ROOTFS}/etc/pmon.d/fsmon.conf
ln -s /usr/share/starlingx/pmon.d/hbsAgent.conf ${IMAGE_ROOTFS}/etc/pmon.d/hbsAgent.conf
ln -s /usr/share/starlingx/pmon.d/hbsClient.conf ${IMAGE_ROOTFS}/etc/pmon.d/hbsClient.conf
ln -s /usr/share/starlingx/pmon.d/lmon.conf ${IMAGE_ROOTFS}/etc/pmon.d/lmon.conf
ln -s /usr/share/starlingx/pmon.d/logmgmt ${IMAGE_ROOTFS}/etc/pmon.d/logmgmt
ln -s /usr/share/starlingx/pmon.d/mtcClient.conf ${IMAGE_ROOTFS}/etc/pmon.d/mtcClient.conf
ln -s /usr/share/starlingx/pmon.d/mtcalarm.conf ${IMAGE_ROOTFS}/etc/pmon.d/mtcalarm.conf
ln -s /usr/share/starlingx/pmon.d/mtclogd.conf ${IMAGE_ROOTFS}/etc/pmon.d/mtclogd.conf
ln -s /usr/share/starlingx/pmon.d/sm-api.conf ${IMAGE_ROOTFS}/etc/pmon.d/sm-api.conf
ln -s /usr/share/starlingx/pmon.d/sm-eru.conf ${IMAGE_ROOTFS}/etc/pmon.d/sm-eru.conf
ln -s /usr/share/starlingx/pmon.d/sm.conf ${IMAGE_ROOTFS}/etc/pmon.d/sm.conf
ln -s /usr/share/starlingx/pmon.d/sshd.conf ${IMAGE_ROOTFS}/etc/pmon.d/sshd.conf
ln -s /usr/share/starlingx/pmon.d/sssd.conf ${IMAGE_ROOTFS}/etc/pmon.d/sssd.conf
ln -s /usr/share/starlingx/pmon.d/sw-patch-agent.conf ${IMAGE_ROOTFS}/etc/pmon.d/sw-patch-agent.conf
ln -s /usr/share/starlingx/pmon.d/sw-patch-controller-daemon.conf ${IMAGE_ROOTFS}/etc/pmon.d/sw-patch-controller-daemon.conf
ln -s /usr/share/starlingx/pmon.d/sysinv-agent.conf ${IMAGE_ROOTFS}/etc/pmon.d/sysinv-agent.conf
ln -s /usr/share/starlingx/pmon.d/syslog-ng.conf ${IMAGE_ROOTFS}/etc/pmon.d/syslog-ng.conf
fi
if [ "${worker}" = true ] ; then
ilog "Setting up pmon files for ${TRAIT__WORKER} and/or ${TRAIT__WORKER} side of ${SYSTEM_TYPE__AIO}"
ln -s /usr/share/starlingx/pmon.d/acpid.conf ${IMAGE_ROOTFS}/etc/pmon.d/acpid.conf
ln -s /usr/share/starlingx/pmon.d/containerd.conf ${IMAGE_ROOTFS}/etc/pmon.d/containerd.conf
ln -s /usr/share/starlingx/pmon.d/docker.conf ${IMAGE_ROOTFS}/etc/pmon.d/docker.conf
ln -s /usr/share/starlingx/pmon.d/fsmon.conf ${IMAGE_ROOTFS}/etc/pmon.d/fsmon.conf
ln -s /usr/share/starlingx/pmon.d/guestServer.conf ${IMAGE_ROOTFS}/etc/pmon.d/guestServer.conf
ln -s /usr/share/starlingx/pmon.d/hbsClient.conf ${IMAGE_ROOTFS}/etc/pmon.d/hbsClient.conf
ln -s /usr/share/starlingx/pmon.d/isolcpu_plugin.conf ${IMAGE_ROOTFS}/etc/pmon.d/isolcpu_plugin.conf
ln -s /usr/share/starlingx/pmon.d/lmon.conf ${IMAGE_ROOTFS}/etc/pmon.d/lmon.conf
ln -s /usr/share/starlingx/pmon.d/logmgmt ${IMAGE_ROOTFS}/etc/pmon.d/logmgmt
ln -s /usr/share/starlingx/pmon.d/mtcClient.conf ${IMAGE_ROOTFS}/etc/pmon.d/mtcClient.conf
ln -s /usr/share/starlingx/pmon.d/mtcalarm.conf ${IMAGE_ROOTFS}/etc/pmon.d/mtcalarm.conf
ln -s /usr/share/starlingx/pmon.d/mtclogd.conf ${IMAGE_ROOTFS}/etc/pmon.d/mtclogd.conf
ln -s /usr/share/starlingx/pmon.d/sm-eru.conf ${IMAGE_ROOTFS}/etc/pmon.d/sm-eru.conf
ln -s /usr/share/starlingx/pmon.d/sshd.conf ${IMAGE_ROOTFS}/etc/pmon.d/sshd.conf
ln -s /usr/share/starlingx/pmon.d/sssd.conf ${IMAGE_ROOTFS}/etc/pmon.d/sssd.conf
ln -s /usr/share/starlingx/pmon.d/sw-patch-agent.conf ${IMAGE_ROOTFS}/etc/pmon.d/sw-patch-agent.conf
ln -s /usr/share/starlingx/pmon.d/sysinv-agent.conf ${IMAGE_ROOTFS}/etc/pmon.d/sysinv-agent.conf
ln -s /usr/share/starlingx/pmon.d/sysinv-fpga-agent.conf ${IMAGE_ROOTFS}/etc/pmon.d/sysinv-fpga-agent.conf
ln -s /usr/share/starlingx/pmon.d/syslog-ng.conf ${IMAGE_ROOTFS}/etc/pmon.d/syslog-ng.conf
fi
true
%end