Skip to content

Commit

Permalink
Merge pull request moby#11853 from EricR/doc-PkgSysInfo
Browse files Browse the repository at this point in the history
Add some basic doc for SysInfo
  • Loading branch information
crosbymichael committed Mar 27, 2015
2 parents cc609c7 + 3716df5 commit 7cc7360
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkg/sysinfo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SysInfo stores information about which features a kernel supports.
4 changes: 3 additions & 1 deletion pkg/sysinfo/sysinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ import (
"github.com/docker/libcontainer/cgroups"
)

// SysInfo stores information about which features a kernel supports.
type SysInfo struct {
MemoryLimit bool
SwapLimit bool
IPv4ForwardingDisabled bool
AppArmor bool
}

// New 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 {
Expand All @@ -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 {
Expand Down

0 comments on commit 7cc7360

Please sign in to comment.