StackScript output to a log?

New user of linode here, so be gentle. Does StackScript send it's output to any log flies? Or can you set something to log what happens? I'd like to have all the standard output saved to a file so I can see what happened.

4 Replies

Output from your script is sent to the console. Use lish to connect before booting. Optionally, use the script command on a Linux box just before connecting to lish, and you'll have a logfile on the local machine.

The script that is run is just a regular script run by whatever you put in the shebang. Under bash or anything else, you can just use "tee" to print something to the console as well as a file.

Or, if you don't care about stdout going to the console, you can just rebind stdout to a file like this (under bash):

exec >/root/stdout.txt
echo Stuff from here on inherits bash stdout, so it goes to the file

Do you also need a "exec 2>&1" to cover stderr? Or is the build environment already doing that sort of thing earlier?


Do you also need a "exec 2>&1" to cover stderr?
Yes, you need to do this. Or you could simply type exec >/root/stdout.txt 2>&1


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