By davidavdav
One of the clever things that digitalocean does is to set the hostname of a new droplet to a sensible value. When, and how, does this happen?
I have a third-party daemon (newrelic-sysmond) that needs to know the hostname. When it starts, the hostname still is packer-... and not the hostname set by the digitalocean droplet initiating process. In the /etc/rc structure, the hostname is set in rcS.d/S01hostname.sh, which should occur before rc2.d/S01newrelic-sysmond. However, it seems the hostname still has the name at image-creation time by the time rc2.d/S01newrelic-sysmond is run.
Cheers,
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!
The hostname is set based on the name given the droplet. This is done (to the best of my knowledge) via cloud-init on the first boot. You should be able to review this process by looking at /var/log/cloud-init.log and /var/log/cloud-init-output.log
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.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.