#!/sbin/itype # This is a i file, used by initng parsed by install_service # NAME: hostname # DESCRIPTION: Sets the system hostname service system/hostname { need = system/initial; env HOSTNAME=localhost; env_file = /etc/sysconfig/network; script start = { # If the hostname is already set via the kernel, and # /etc/hostname isn't setup, then we shouldn't go reseting the # configuration #38172. if [ "${HOSTNAME}" ] then /bin/true elif [ -f /etc/hostname ] then HOSTNAME=$(/bin/cat /etc/hostname) elif host=$(/bin/hostname) [ -z "${host}" -o "${host}" = '(none)' ] then HOSTNAME=${host} else HOSTNAME='localhost' fi exec /bin/hostname "${HOSTNAME}" }; }