Set hostname on RHEL 7 correctly

I was having trouble when setting the hostname on RHEL 7, this PR fixes it.