From 01bbc3fbb9c3ab3dec0f271710739465b0f80b7a Mon Sep 17 00:00:00 2001 From: Eric Rafaloff Date: Thu, 26 Mar 2015 23:05:07 -0400 Subject: [PATCH] Add some basic doc for SysInfo Signed-off-by: Eric Rafaloff --- pkg/sysinfo/README.md | 1 + pkg/sysinfo/sysinfo.go | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 pkg/sysinfo/README.md diff --git a/pkg/sysinfo/README.md b/pkg/sysinfo/README.md new file mode 100644 index 0000000000..c1530cef0d --- /dev/null +++ b/pkg/sysinfo/README.md @@ -0,0 +1 @@ +SysInfo stores information about which features a kernel supports. diff --git a/pkg/sysinfo/sysinfo.go b/pkg/sysinfo/sysinfo.go index 506124e74e..7c769e3082 100644 --- a/pkg/sysinfo/sysinfo.go +++ b/pkg/sysinfo/sysinfo.go @@ -9,6 +9,7 @@ import ( "github.com/docker/libcontainer/cgroups" ) +// SysInfo stores information about which features a kernel supports. type SysInfo struct { MemoryLimit bool SwapLimit bool @@ -16,6 +17,7 @@ type SysInfo struct { AppArmor bool } +// Returns a new SysInfo, using the filesystem to detect which features the kernel supports. func New(quiet bool) *SysInfo { sysInfo := &SysInfo{} if cgroupMemoryMountpoint, err := cgroups.FindCgroupMountpoint("memory"); err != nil { @@ -37,7 +39,7 @@ func New(quiet bool) *SysInfo { } } - // Check if AppArmor seems to be enabled on this system. + // Check if AppArmor is supported if _, err := os.Stat("/sys/kernel/security/apparmor"); os.IsNotExist(err) { sysInfo.AppArmor = false } else {