Set PS4 in stack.sh to provide additional debug info
Add:
export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
To stack.sh to provide additional debug info. This will show the
filename, line number, function name, and the content of the line.
An example output line:
+++(/opt/stack/old/devstack/functions-common:675): get_field(): local data field
Info on this PS4 variable found at:
http://wiki.bash-hackers.org/scripting/debuggingtips
Change-Id: I272df6c79f6ff7afa8f102da24706558d9169eda
diff --git a/stack.sh b/stack.sh
index e9831d5..91e7204 100755
--- a/stack.sh
+++ b/stack.sh
@@ -23,6 +23,7 @@
# Print the commands being run so that we can see the command that triggers
# an error. It is also useful for following along as the install occurs.
set -o xtrace
+export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
# Make sure custom grep options don't get in the way
unset GREP_OPTIONS
@@ -238,6 +239,7 @@
# see them by forcing ``PATH``
echo "Defaults:$STACK_USER secure_path=/sbin:/usr/sbin:/usr/bin:/bin:/usr/local/sbin:/usr/local/bin" >> $TEMPFILE
echo "Defaults:$STACK_USER !requiretty" >> $TEMPFILE
+echo "Defaults env_keep += PS4" >> $TEMPFILE
chmod 0440 $TEMPFILE
sudo chown root:root $TEMPFILE
sudo mv $TEMPFILE /etc/sudoers.d/50_stack_sh