Stackscripts - how to debug ?
Thank you.
3 Replies
function system_update {
apt-get update
apt-get -y install aptitude
aptitude -y full-upgrade
}
I personally like to add
set -e
at the top of my stack scripts to make sure they fail on error. You can copy a stack script and add that to the top if you like.
EDIT:
I guess you got the best answer. Open the Lish console and rebuild the Linode using the StackScript. You can see the process and get an idea of where it stops.
I just ran into this and have a fix that works for me and might help others.
#!/bin/bash -e
exec > >(tee -i /var/log/stackscript.log)
Top of StackScript with output logging
- Create instance with the StackScript changes above.
- Once the console shows "Running"
- Launch Console
- Glish
- Login as root
tail -f /var/log/stackscript.log