// Setup NFS share func (d *Driver) setupNFSShare() error { nfsConfig := fmt.Sprintf("/Users %s -alldirs -maproot=root", d.IPAddress) if _, err := nfsexports.Add("", d.nfsExportIdentifier(), nfsConfig); err != nil { return err } if err := nfsexports.ReloadDaemon(); err != nil { return err } hostIP, err := vmnet.GetNetAddr() if err != nil { return err } bootScriptName := "/var/lib/boot2docker/bootlocal.sh" bootScript := fmt.Sprintf("#/bin/bash\\n"+ "sudo mkdir -p /Users\\n"+ "sudo /usr/local/etc/init.d/nfs-client start\\n"+ "sudo mount -t nfs -o noacl,async %s:/Users /Users\\n", hostIP) writeScriptCmd := fmt.Sprintf("echo -e \"%s\" | sudo tee %s && sudo chmod +x %s && %s", bootScript, bootScriptName, bootScriptName, bootScriptName) if _, err := drivers.RunSSHCommandFromDriver(d, writeScriptCmd); err != nil { return err } return nil }
func AddExport(uuid string) error { export := fmt.Sprintf("/Users %s -alldirs -mapall=%s:%s", "-network 192.168.64.0 -mask 255.255.255.0", os.Getenv("SUDO_UID"), os.Getenv("SUDO_GID")) _, err := nfsexports.Add("", "dlite", export) if err != nil { return err } return nfsexports.ReloadDaemon() }
func AddExport(uuid, share string) error { if share == "" { share = "/Users" } export := fmt.Sprintf("%s -network 192.168.64.0 -mask 255.255.255.0 -alldirs -maproot=root:wheel", share) _, err := nfsexports.Add("", "dlite", export) if err != nil { return err } err = nfsexports.ReloadDaemon() if err != nil { return exec.Command("sudo", "nfsd", "start").Run() } return err }
func AddExport(uuid, share string) error { if share == "" { share = "/Users" } export := fmt.Sprintf("%s -network 192.168.64.0 -mask 255.255.255.0 -alldirs -mapall=%s:%s", share, os.Getenv("SUDO_UID"), os.Getenv("SUDO_GID")) _, err := nfsexports.Add("", "dlite", export) if err != nil { return err } err = nfsexports.ReloadDaemon() if err != nil { return exec.Command("sudo", "nfsd", "start").Run() } return err }