TT#37257 Stop writing ngcp-installer-debug.log (it duplicates deployment-installer-debug.log)

We have confusing situation for an ages here.
We were writing a lot of log files:
> /var/log/deployment-installer-debug.log
> /var/log/ngcp-installer.log
> /var/log/ngcp-installer-debug.log

The first one contains all the GRML boot, Debian debootstrap
and ngcp-installer-debug.log already. Also having both
ngcp-installer.log and ngcp-installer-debug.log confuses
new users as they do not know which logs they need to
check first to see ngcp-installer logs.

There is no need to keep both files anymore.
Nowadays we have a nice way to distinguish logs between components,
so /var/log/deployment-installer-debug.log is enough here:

> +15:07:48 (netscript.grml:1403): main():  echo 'Generating ngcp-installer run script ...'
> +15:07:48 (netscript.grml:1404): main():  cat
> +15:07:48 (netscript.grml:1417): main():  echo 'Execute ngcp-installer inside deployment chroot environment ...'
> ...
> Running ngcp-installer via grml-chroot.
> ...
> +17:07:48 (ngcp-installer:27): main():  . /usr/share/ngcp-installer//system_pro.inc
> +17:07:48 (ngcp-installer:28): main():  . /usr/share/ngcp-installer//packages.inc
> +17:07:48 (ngcp-installer:31): main():  . /usr/share/ngcp-installer//cfg.inc
> ...
> +17:07:57 (packages.inc:58): packages_ppa_sourceslist():  echo '(system installed using NGCP PPA: gerrit_gtid_imp)'
> +17:07:57 (ngcp-installer:54): main():  packages_aptconfig
> +17:07:57 (packages.inc:90): packages_aptconfig():  mkdir -p /etc/apt/preferences.d
> +17:07:57 (packages.inc:92): packages_aptconfig():  cat

The commit here should minimize amount of log files we
produce and should simplify the debug process.

Change-Id: I26a2ca8e21a3385f7d57d830feb207bbb1039b39
changes/71/23571/1
Alexander Lutay 8 years ago
parent d759835966
commit 8d86272571

@ -1403,13 +1403,13 @@ if "$NGCP_INSTALLER" ; then
echo "Generating ngcp-installer run script ..."
cat > "${TARGET}/tmp/ngcp-installer-deployment.sh" << "EOT"
#!/bin/bash
echo "Running ngcp-installer via grml-chroot." | tee -a /tmp/ngcp-installer-debug.log
ngcp-installer 2>&1 | tee -a /tmp/ngcp-installer-debug.log
RC=${PIPESTATUS[0]}
if [ "${RC}" = "0" ] ; then
echo "OK, ngcp-installer finished with exit code '${RC}', continue netscript deployment." | tee -a /tmp/ngcp-installer-debug.log
echo "Running ngcp-installer via grml-chroot."
ngcp-installer 2>&1
RC=$?
if [ "${RC}" = "0" ]; then
echo "OK, ngcp-installer finished successfully, continue netscript deployment."
else
echo "ERROR: Fatal error while running ngcp-installer (exit code '${RC}')!" | tee -a /tmp/ngcp-installer-debug.log >&2
echo "ERROR: Fatal error while running ngcp-installer (exit code '${RC}')!"
exit ${RC}
fi
EOT
@ -1434,7 +1434,7 @@ EOT
cp /etc/network/interfaces "${TARGET}/etc/network/"
unset method netcardconf
else
die "Error during installation of ngcp. Find details at: ${TARGET}/var/log/ngcp-installer.log ${TARGET}/tmp/ngcp-installer-debug.log"
die "Error during installation of ngcp. Find details at: ${TARGET}/var/log/ngcp-installer.log"
fi
echo "Temporary files cleanup ..."
@ -1442,10 +1442,7 @@ EOT
:>$TARGET/var/run/utmp
:>$TARGET/var/run/wtmp
echo "Backup of the installer logfiles for later investigation ..."
if [ -r "${TARGET}"/tmp/ngcp-installer-debug.log ] ; then
cp "${TARGET}"/tmp/ngcp-installer-debug.log "${TARGET}"/var/log/
fi
echo "Backup grml-debootstrap.log for later investigation ..."
if [ -r /tmp/grml-debootstrap.log ] ; then
cp /tmp/grml-debootstrap.log "${TARGET}"/var/log/
fi

Loading…
Cancel
Save