Skip to content

Commit 09883c0

Browse files
author
John L. Villalovos
committed
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
1 parent c09c079 commit 09883c0

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

stack.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
# Print the commands being run so that we can see the command that triggers
2424
# an error. It is also useful for following along as the install occurs.
2525
set -o xtrace
26+
export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
2627

2728
# Make sure custom grep options don't get in the way
2829
unset GREP_OPTIONS
@@ -238,6 +239,7 @@ echo "$STACK_USER ALL=(root) NOPASSWD:ALL" >$TEMPFILE
238239
# see them by forcing ``PATH``
239240
echo "Defaults:$STACK_USER secure_path=/sbin:/usr/sbin:/usr/bin:/bin:/usr/local/sbin:/usr/local/bin" >> $TEMPFILE
240241
echo "Defaults:$STACK_USER !requiretty" >> $TEMPFILE
242+
echo "Defaults env_keep += PS4" >> $TEMPFILE
241243
chmod 0440 $TEMPFILE
242244
sudo chown root:root $TEMPFILE
243245
sudo mv $TEMPFILE /etc/sudoers.d/50_stack_sh

0 commit comments

Comments
 (0)