By fastest963
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?
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.
