Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
6
rated 0 times [  6] [ 0]  / answers: 1 / hits: 14455  / 2 Years ago, thu, may 19, 2022, 7:29:49

If I paste a shell script into the user-data box when starting the standard Ubuntu AMI on EC2, I'm using cloud-init, am I not? My question is where does it log the output of such a script? Do I have to do something to turn logging on? I can't find logs for it anywhere.



Ubuntu-raring-13.04-amd64-server-20130423 (ami-c30360aa)



Thanks!


More From » cloud-init

 Answers
5

Output of your program is available on the console log. You can get that either from the aws console, or by calling the GetConsoleOutput via the api (or with a tool such as euca-get-console-output or ec2-get-console-output).



Additionally, you can tell cloud-init to log the output of those commands by providing user-data that tells it to.



#cloud-config
output: {all: '| tee -a /var/log/cloud-init-output.log'}


You can provide multi-part input to give both '#!' scripts and cloud-config as shown above. See https://help.ubuntu.com/community/CloudInit for an example of how to do that.


[#29443] Saturday, May 21, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
oileweaty

Total Points: 337
Total Questions: 108
Total Answers: 105

Location: Western Sahara
Member since Mon, May 3, 2021
3 Years ago
oileweaty questions
Thu, Jul 1, 21, 01:57, 3 Years ago
Wed, Nov 24, 21, 11:48, 2 Years ago
Sat, May 14, 22, 00:50, 2 Years ago
;