From 1e3a5d2d6cfd298080a9596ae4efa5c450341b69 Mon Sep 17 00:00:00 2001 From: Bob Ball Date: Fri, 16 Jan 2015 13:06:58 +0000 Subject: [PATCH] XenAPI: Use SCREEN_LOGDIR rather than assuming a static value This value was defined in Citrix's install-devstack-xen script, so only worked for those using that script. Change-Id: Iab63389f41760865f2b67f6dccd57d774e889905 --- tools/xen/install_os_domU.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/tools/xen/install_os_domU.sh b/tools/xen/install_os_domU.sh index 753f06a83d..546ead6127 100755 --- a/tools/xen/install_os_domU.sh +++ b/tools/xen/install_os_domU.sh @@ -371,14 +371,19 @@ if [ "$WAIT_TILL_LAUNCH" = "1" ] && [ -e ~/.ssh/id_rsa.pub ] && [ "$COPYENV" = done echo -n "devstack service is running, waiting for stack.sh to start logging..." - while ! ssh_no_check -q stack@$OS_VM_MANAGEMENT_ADDRESS "test -e /tmp/devstack/log/stack.log"; do - sleep 10 - done - set -x - pid=`ssh_no_check -q stack@$OS_VM_MANAGEMENT_ADDRESS "cat /opt/stack/run_sh.pid"` - ssh_no_check -q stack@$OS_VM_MANAGEMENT_ADDRESS "tail --pid $pid -n +1 -f /tmp/devstack/log/stack.log" + if [ -n "$SCREEN_LOGDIR" ]; then + while ! ssh_no_check -q stack@$OS_VM_MANAGEMENT_ADDRESS "test -e ${SCREEN_LOGDIR}/stack.log"; do + sleep 10 + done + ssh_no_check -q stack@$OS_VM_MANAGEMENT_ADDRESS "tail --pid $pid -n +1 -f ${SCREEN_LOGDIR}/stack.log" + else + echo -n "SCREEN_LOGDIR not set; just waiting for process $pid to finish" + ssh_no_check -q stack@$OS_VM_MANAGEMENT_ADDRESS "wait $pid" + fi + + set -x # Fail if devstack did not succeed ssh_no_check -q stack@$OS_VM_MANAGEMENT_ADDRESS 'test -e /opt/stack/runsh.succeeded'