Fix hostname setting in Redhat and centos