fixed core dump when host does not have /etc/hostname
file present.