2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-02-13 17:19:29 +00:00

Change logging/display for RH oses

The pre and post phases are
desirable to see both in logs and consoles.

Unfortunately, anaconda cheaps out by using communicate(), which means
the logs are unwritten until the end.

Change by using bash's redirectiors
to create a dynamically updated logfile
and tail -f that.
This commit is contained in:
Jarrod Johnson 2021-04-30 09:39:00 -04:00
parent f32619aa3e
commit 4df3fda8ea
6 changed files with 23 additions and 18 deletions

View File

@ -1,5 +1,7 @@
#!/bin/sh
tail -f /tmp/nochroot/${0}.log >& /dev/tty &
mkdir -p /var/log/confluent
exec >> /var/log/confluent/confluent-post.log
tail -f /var/log/confluent/confluent-post.log > /dev/tty &
# need to copy over ssh key info
nodename=$(grep ^NODENAME /etc/confluent/confluent.info|awk '{print $2}')
apikey=$(cat /etc/confluent/confluent.apikey)

View File

@ -1,5 +1,4 @@
#!/bin/sh
tail -f ${0}.log >& /dev/tty &
# This runs prior to the installer beginning. This is used to rewrite the
# scripted install file, merging data from confluent and identifying
@ -8,7 +7,12 @@ tail -f ${0}.log >& /dev/tty &
# If you want to use a more custom partition plan, the easiest
# method is to edit the kicktstart file and comment out or
# delete %include /tmp/partitioning
if [ -f "/run/install/cmdline.d/01-autocons.conf" ]; then
consoledev=$(cat /run/install/cmdline.d/01-autocons.conf | sed -e 's!console=!/dev/!' -e 's/,.*//')
TMUX= tmux a <> $consoledev >&0 2>&1 &
fi
exec >> /tmp/confluent-pre.log
tail -f /tmp/confluent-pre.log > /dev/tty &
nodename=$(grep ^NODENAME /etc/confluent/confluent.info|awk '{print $2}')
locale=$(grep ^locale: /etc/confluent/confluent.deploycfg)
locale=${locale#locale: }
@ -50,10 +54,6 @@ for pubkey in /etc/ssh/ssh_host*key.pub; do
echo HostCertificate $certfile >> /etc/ssh/sshd_config.anaconda
done
/usr/sbin/sshd -f /etc/ssh/sshd_config.anaconda
if [ -f "/run/install/cmdline.d/01-autocons.conf" ]; then
consoledev=$(cat /run/install/cmdline.d/01-autocons.conf | sed -e 's!console=!/dev/!' -e 's/,.*//')
TMUX= tmux a <> $consoledev >&0 2>&1 &
fi
cryptboot=$(grep ^encryptboot: /etc/confluent/confluent.deploycfg | awk '{print $2}')
LUKSPARTY=''
touch /tmp/addonpackages

View File

@ -16,8 +16,8 @@ cp /tmp/functions /mnt/sysimage/etc/confluent/
if [ -f /tmp/cryptboot ]; then
cp /tmp/cryptboot /mnt/sysimage/tmp/
fi
mkdir -p /mnt/sysimage/tmp/nochroot/tmp
mount -o bind,ro /tmp/ /mnt/sysimage/tmp/nochroot/tmp
mkdir -p /mnt/sysimage/var/log/confluent
mv /tmp/confluent-pre.log /mnt/sysimage/var/log/confluent
echo Port 2222 >> /etc/ssh/sshd_config.anaconda
echo Match LocalPort 22 >> /etc/ssh/sshd_config.anaconda
echo " ChrootDirectory /mnt/sysimage" >> /etc/ssh/sshd_config.anaconda

View File

@ -1,5 +1,7 @@
#!/bin/sh
tail -f /tmp/nochroot/${0}.log >& /dev/tty &
mkdir -p /var/log/confluent
exec >> /var/log/confluent/confluent-post.log
tail -f /var/log/confluent/confluent-post.log > /dev/tty &
# need to copy over ssh key info
nodename=$(grep ^NODENAME /etc/confluent/confluent.info|awk '{print $2}')
apikey=$(cat /etc/confluent/confluent.apikey)

View File

@ -7,8 +7,12 @@
# If you want to use a more custom partition plan, the easiest
# method is to edit the kicktstart file and comment out or
# delete %include /tmp/partitioning
tail -f ${0}.log >& /dev/tty &
if [ -f "/run/install/cmdline.d/01-autocons.conf" ]; then
consoledev=$(cat /run/install/cmdline.d/01-autocons.conf | sed -e 's!console=!/dev/!' -e 's/,.*//')
tmux a <> $consoledev >&0 2>&1 &
fi
exec >> /tmp/confluent-pre.log
tail -f /tmp/confluent-pre.log > /dev/tty &
/usr/libexec/platform-python /etc/confluent/apiclient >& /dev/null
nicname=$(ip link|grep ^$(cat /tmp/confluent.ifidx): | awk '{print $2}' | awk -F: '{print $1}')
nmcli c u $nicname
@ -57,10 +61,7 @@ done
grep -v RSAAuthentication /etc/ssh/sshd_config.anaconda > /etc/ssh/sshd_config.anaconda.new
mv /etc/ssh/sshd_config.anaconda.new /etc/ssh/sshd_config.anaconda
/usr/sbin/sshd -f /etc/ssh/sshd_config.anaconda
if [ -f "/run/install/cmdline.d/01-autocons.conf" ]; then
consoledev=$(cat /run/install/cmdline.d/01-autocons.conf | sed -e 's!console=!/dev/!' -e 's/,.*//')
tmux a <> $consoledev >&0 2>&1 &
fi
cryptboot=$(grep ^encryptboot: /etc/confluent/confluent.deploycfg | awk '{print $2}')
LUKSPARTY=''
touch /tmp/cryptpkglist

View File

@ -16,8 +16,8 @@ cp /tmp/functions /mnt/sysimage/etc/confluent/
if [ -f /tmp/cryptboot ]; then
cp /tmp/cryptboot /mnt/sysimage/tmp/
fi
mkdir -p /mnt/sysimage/tmp/nochroot/tmp
mount -o bind,ro /tmp/ /mnt/sysimage/tmp/nochroot/tmp
mkdir -p /mnt/sysimage/var/log/confluent
mv /tmp/confluent-pre.log /mnt/sysimage/var/log/confluent
echo Port 2222 >> /etc/ssh/sshd_config.anaconda
echo Match LocalPort 22 >> /etc/ssh/sshd_config.anaconda
echo " ChrootDirectory /mnt/sysimage" >> /etc/ssh/sshd_config.anaconda