Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have setup an Ubuntu 8.10 server instance on Amazon EC2. I install ejabberd on server, but I face some problems on ejabberd node can't start because hostname on cloud changes each time we relaunch the instance. After I follow this link http://blog.kenweiner.com/2008/05/ejabberd-on-amazon-ec2-ubuntu-ami.html to edit and add hostname in /etc/hosts file, it works. Unfortunately, every time I reboot the server, the /etc/hosts file get reset to default.

How could I solve this problem?

share|improve this question
    
I'm running Ubuntu (desktop) 10.10 on my laptop and the problem with the /etc/hosts files persists. It's reseted any time I reboot. Googling for a solution I just found this thread. No luck at this moment. :( –  Bilbo Jan 28 '11 at 14:37
add comment

migrated from stackoverflow.com Jan 28 '11 at 14:37

This question came from our site for professional and enthusiast programmers.

2 Answers

This is a known problem with the current Ubuntu images for EC2 built by Canonical:

https:// bugs.launchpad.net/ubuntu-on-ec2/+bug/371936

You can wait for the next release from Canonical or run the Ubuntu images for EC2 which I publish on http:// alestic.com (and which do not have the same problem).

I have successfully run ejabberd on the Alestic.com images.

share|improve this answer
add comment

You could try CloudInit to perform your hosts file cleanup during instance boot. It is included in all the current official Ubuntu EC2 images and allows you to run initialization scripts passed by the --user-data switch of ec2-run-instances (or the respective input field(s) in the AWS Console wizard) which will be run at boot. Kind of like rc.local.

Edit: I did not realize it was Eric himself who wrote the other comment, at first. He's got lots of useful entries in his blog at Alestic, including one regarding the mentioned UserData.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.