refactor: improve installation reliability

This change aims to make installations more unified and reliable. It
introduces the concept of a mountpoint manager that is capable of
mounting, unmounting, and moving a set of mountpoints in the correct
order.

Signed-off-by: Andrew Rynhard <andrew@andrewrynhard.com>
This commit is contained in:
Andrew Rynhard
2019-07-31 17:16:10 +00:00
parent 9c63f4ed0a
commit ca35b85300
54 changed files with 1378 additions and 1244 deletions

View File

@@ -6,26 +6,12 @@ package proc
import (
"fmt"
"io/ioutil"
"path"
"strings"
"code.cloudfoundry.org/bytefmt"
"github.com/prometheus/procfs"
)
// SystemProperty represents a kernel system property.
type SystemProperty struct {
Key string
Value string
}
// WriteSystemProperty writes a value to a key under /proc/sys.
func WriteSystemProperty(prop *SystemProperty) error {
keyPath := path.Join("/proc/sys", strings.Replace(prop.Key, ".", "/", -1))
return ioutil.WriteFile(keyPath, []byte(prop.Value), 0644)
}
// ProcessList contains all of the process stats we want
// to display via top
type ProcessList struct {