For some reason, we assume that "hostname" and "uname -n" return the FQDN. That is not a proper configuration.

The "hostname" is the short name of the machine. So for a machine designated by foo.example.com, "hostname" (and uname -n) should return "foo" and hostname -f should return foo.example.com.

This is documented in a few places, but just an example:

http://www.debian.org/doc/manuals/debian-reference/ch05.en.html#_the_hos...

We should make sure people configure their /etc/hosts correctly (which we do, i think) and make sure they configure their hostname correctly too (which we don't, and we assume that we set the /etc/hostname to the FQDN, which is wrong).

Comments

anarcat’s picture

Status: Active » Needs review

Basically, I think this means changing the INSTALL.txt to read this:

  AEGIR_HOST=`hostname -f`
  resolveip $AEGIR_HOST

instead of this:

  AEGIR_HOST=`uname -n`
  resolveip $AEGIR_HOST

Would that be sufficient? Where else did we cook in that assumption?

Anonymous’s picture

php_uname is littered all through install.hostmaster.inc, migrate.hostmaster.inc and provision.inc's provision_is_local_host($host) function

Anonymous’s picture

The more I think about it, it should *definitely* use the FQDN. I added a remote web server and because uname -n was 'aegir' on my other host (which resolved to the public IP due to /etc/hosts on Rackspace Cloud servers), it was trying to talk back to the database on the main server as 'aegir' and couldn't, obviously until I fudged the hosts on the remote web server.

If it was the FQDN, it would likely 'just work'.

Anonymous’s picture

Status: Needs review » Needs work

hostname -f ought to work - however the fun won't end there. Slicehost and Rackspace servers, for example, set the fqdn as the name of the server when you create it.

In other words, if I spin up a server called 'aegir-02', the short and fqdn of the server is 'aegir-02'.

Given the popularity of such providers, I think we'd still be obligated to give an example of a hosts fudge to make this work.

Adrian, want to update this ticket on what stuff you were doing with slicehost and puppet around this area?

adrian’s picture

this could work if we get rid of uname -n

  host { "$hostname" :
    ip => $ipaddress,
    ensure => absent,
  }
  host { "$hostname.$domain" :
    ip => $ipaddress,
    host_aliases => [ $hostname ]
  }

save that to hostname.pp and run puppet hostname.pp as root.

Anonymous’s picture

Status: Needs work » Fixed

We just prompt for this now on install, and require a FQDN. So I think we can just close this.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.