Stackscripts - how to debug ?

Hi, maybe I'm missing something but how to debug a stackscript ? There are only a few informations about stackscripts and it seems I'm missing something here. I tried to deploy a stackscript but it is unclear how to see the flow of the script.

Thank you.

3 Replies

Most stack scripts contain bash functions, if we take … criptID=10"> for example after the include statement which adds … ScriptID=1"> into the top of the script, it runs system_update which does the following

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.

I'm not sure you got an answer to the original question, which was how to go about debugging a StackScript. I have the same question, but given the age of this message it may require starting a new thread.


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
  1. Create instance with the StackScript changes above.
  2. Once the console shows "Running"
  3. Launch Console
  4. Glish
  5. Login as root
  6. tail -f /var/log/stackscript.log


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct