From 67153a9a28ec1f79570431640681f03535ebcc22 Mon Sep 17 00:00:00 2001 From: brl Date: Fri, 5 Jun 2015 18:32:24 -0400 Subject: [PATCH] set hostname in sandbox to profile name --- oz-init/init.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/oz-init/init.go b/oz-init/init.go index 7bc4cad..e0aa228 100644 --- a/oz-init/init.go +++ b/oz-init/init.go @@ -111,6 +111,11 @@ func parseArgs() *initState { func (st *initState) runInit() { st.log.Info("Starting oz-init for profile: %s", st.profile.Name) st.log.Info("Socket address: %s", st.address) + if syscall.Sethostname([]byte(st.profile.Name)) != nil { + st.log.Error("Failed to set hostname to (%s)", st.profile.Name) + } + st.log.Info("Hostname set to (%s)", st.profile.Name) + if err := st.fs.OzInit(); err != nil { st.log.Error("Error: setting up filesystem failed: %v\n", err) os.Exit(1)