From 75cbcbe0ab505b13efefbf93dbc1f6f57f24c427 Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Mon, 7 Mar 2016 16:32:24 +0000 Subject: cloud-init.configure: Fix use of MORPH_LOG_FD MORPH_LOG_FD exists so that deployment extensions can write detailed log info to a file. This extension doesn't output much detailed log info, but some of the Python ones do & it's really useful for debugging. With Morph, this extension seems to have been writing logs to a file named '3' rather than to the actual deployment log. With YBD, this extension crashed because MORPH_LOG_FD was unset. Extra logs will now go to stdout when deploying with YBD. Change-Id: I46ead092d0e071970e355c8539823836f28dd97b --- extensions/cloud-init.configure | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/extensions/cloud-init.configure b/extensions/cloud-init.configure index aa83e0e2..3bcc0909 100755 --- a/extensions/cloud-init.configure +++ b/extensions/cloud-init.configure @@ -22,6 +22,12 @@ set -e ROOT="$1" +# Write detailed logs to a special log file if set, otherwise everything +# goes to stdout. +if [ -z "$MORPH_LOG_FD" ]; then + MORPH_LOG_FD=1 +fi + ########################################################################## set -e @@ -56,7 +62,7 @@ for service_name in $cloud_init_services; do echo "Failed to configure cloud-init." exit 1 else - echo Enabling systemd service "$service_name" >"$MORPH_LOG_FD" + echo Enabling systemd service "$service_name" >&"$MORPH_LOG_FD" ln -sf "/$services_folder/$service_name" \ "$ROOT/etc/systemd/system/multi-user.target.wants/$service_name" fi -- cgit v1.2.1