[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [HTCondor-users] $(FULL_HOSTNAME)



How does HTCondor determine $(FULL_HOSTNAME)?

It's a variant of the usual routine where you do a reverse lookup of the IP address found by doing a forward resolution of the system hostname. (See below for more details.)

Is there a difference in how it is determined between EL6 and EL7?

Not in HTCondor. However, a number of distribution's default network setup is more or less deliberately broken (from HTCondor's POV): for example, the hostname is included in /etc/hosts as a name for 127.0.0.1 (and ::1, in some cases). While that makes sure that the hostname will always resolve (potentially useful in situations where the host isn't in DNS), it also means that HTCondor will assume (in the best case) that the externally-visible IP address is 127.0.0.1. (In other cases, IIRC, the reverse lookup is not symmetric with the forward lookup and fails, leaving HTCondor with no hostname to use at all.)

The contents of the default /etc/hostname (and the settings of /etc/resolv.conf) may have changed from EL6 to EL7; I haven't investigated.

- ToddM

Below:

Assuming you have neither NETWORK_HOSTNAME nor NO_DNS set, HTCondor does the following (if I'm reading the code right):

calls gethostname()
calls getaddrinfo() on the result
iterates over the results, looking for ai_canonname to be set
if it finds the canonical name, and it contains a '.', set FULL_HOSTNAME
	to the canonical name; if it does not contain a '.', set
	FULL_HOSTNAME to the caonical name followed by a '.' followed by
	the value of DEFAULT_DOMAIN_NAME.

Note that if getaddrinfo() fails to find a canonical name, FULL_HOSTNAME will not be set to anything.