Created
September 25, 2012 16:04
-
-
Save brian-lc/3782794 to your computer and use it in GitHub Desktop.
Attempt to set a hostname in the /etc/rc.local file of an AMI instance. I could not get it to work...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # AMI EC2 /etc/rc.local snipit I could not get to work | |
| META_HOSTNAME = `ec2-describe-tags --filter "resource-type=instance" --filter "resource-id=$(ec2-metadata -i | cut -d ' ' -f2)" --filter "key=Name" | cut -f5` | |
| hostname $META_HOSTNAME |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Works when run manually, when part of the /etc/rc.local file id did not seem to work. Possibly a permissions issue or ec2 env vars issue...
Setting...
hostname '<the_host_name>'
Worked just fine