I don't think this is enough. Don't you also need to call the hostname command? What about /etc/hosts?