Report this

What is the reason for this report?

Attempting to run a bash script via user-data on creation isn't working and no logs

Posted on March 3, 2015

On Google/EC2 I run a bash script to setup a server and after reading https://www.digitalocean.com/community/tutorials/an-introduction-to-droplet-metadata it seems like I can do that on DigitalOcean too.

I’m running into an issue though where the script isn’t running however and I can’t find where the logs are. On Google/EC2 they’re in /var/log/messages on CentOS but I couldn’t find anything in there on DO and the install.log files in /root/ don’t have anything about the script either.

The user-data I’m trying to run is:

#!/bin/bash

curl {script url} | sh

If I log into the box and run that curl/pipe it works fine. I’m using the Control Panel to create the droplet. Is there something I’m missing? Thanks!



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Even I am unable to run the script. I am using API V2

{ “name”: “example.com”, “region”: “nyc3”, “size”: “s-1vcpu-1gb”, “image”: “ubuntu-16-04-x64”, “ssh_keys”: null, “backups”: false, “ipv6”: false, “user_data”: “#cloud-config runcmd: - curl <URL> | sh”, “private_networking”: null, “volumes”: null, “tags”: [ “web” ] }

Please help me regarding what am I doing wrong here?

Sorry to bring an old post up, but I’m having the same issue with a new Centos 7 droplet. This user script - https://github.com/digitalocean/do_user_scripts/blob/master/CentOS-7/web-servers/lamp.yml - won’t get excecuted on droplet creation.

That didn’t run it either :( I also looked in /var/log/messages and still didn’t see anything there referencing that it ever ran this script. I also looked through other logs in /var/log/ and didn’t see anything about it either. Is there another spot where the output goes when this is run?

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.