MCPcopy Create free account
hub / github.com/cloudfoundry/bosh-agent / setupRunDir

Method setupRunDir

platform/linux_platform.go:1015–1045  ·  view source on GitHub ↗
(sysDir, tmppFSSize string)

Source from the content-addressed store, hash-verified

1013}
1014
1015func (p linux) setupRunDir(sysDir, tmppFSSize string) error {
1016 runDir := path.Join(sysDir, "run")
1017
1018 _, runDirIsMounted, err := p.IsMountPoint(runDir)
1019 if err != nil {
1020 return bosherr.WrapErrorf(err, "Checking for mount point %s", runDir)
1021 }
1022
1023 if !runDirIsMounted {
1024 err = p.fs.MkdirAll(runDir, runDirPermissions)
1025 if err != nil {
1026 return bosherr.WrapErrorf(err, "Making %s dir", runDir)
1027 }
1028
1029 if tmppFSSize == "" {
1030 tmppFSSize = "16m"
1031 }
1032
1033 err = p.diskManager.GetMounter().MountTmpfs(runDir, tmppFSSize)
1034 if err != nil {
1035 return bosherr.WrapErrorf(err, "Mounting tmpfs to %s", runDir)
1036 }
1037
1038 _, _, _, err = p.cmdRunner.RunCommand("chown", "root:vcap", runDir)
1039 if err != nil {
1040 return bosherr.WrapErrorf(err, "chown %s", runDir)
1041 }
1042 }
1043
1044 return nil
1045}
1046
1047func (p linux) SetupHomeDir() error {
1048 mounter := boshdisk.NewLinuxBindMounter(p.diskManager.GetMounter())

Callers 1

SetupDataDirMethod · 0.95

Calls 5

IsMountPointMethod · 0.95
MkdirAllMethod · 0.80
MountTmpfsMethod · 0.65
GetMounterMethod · 0.65
RunCommandMethod · 0.65

Tested by

no test coverage detected