Managing HP Serviceguard for Linux, Eighth Edition, March 2008

Designing Highly Available Cluster Applications
Designing Applications to Run on Multiple Systems
Appendix B 347
Use uname(2) With Care
Related to the hostname issue discussed in the previous section is the
application's use of uname(2), which returns the official system name.
The system name is unique to a given system whatever the number of
LAN cards in the system. By convention, the uname and hostname are
the same, but they do not have to be. Some applications, after connection
to a system, might call uname(2) to validate for security purposes that
they are really on the correct system. This is not appropriate in an HA
environment, since the service is moved from one system to another, and
neither the uname nor the hostname are moved. Applications should
develop alternate means of verifying where they are running. For
example, an application might check a list of hostnames that have been
provided in a configuration file.