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
This commit is contained in:
Bob Ball 2015-01-16 13:06:58 +00:00
parent 0686dae661
commit 1e3a5d2d6c

View File

@ -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'