mirror of
https://github.com/shirou/gopsutil.git
synced 2025-04-29 13:49:21 +08:00
Merge pull request #496 from shirou/add_docker_to_use_btime
[host] linux: use uptime even if docker guest.
This commit is contained in:
commit
d76e8c18d8
@ -113,6 +113,9 @@ func BootTimeWithContext(ctx context.Context) (uint64, error) {
|
|||||||
if system == "lxc" && role == "guest" {
|
if system == "lxc" && role == "guest" {
|
||||||
// if lxc, /proc/uptime is used.
|
// if lxc, /proc/uptime is used.
|
||||||
statFile = "uptime"
|
statFile = "uptime"
|
||||||
|
} else if system == "docker" && role == "guest" {
|
||||||
|
// also docker, guest
|
||||||
|
statFile = "uptime"
|
||||||
}
|
}
|
||||||
|
|
||||||
filename := common.HostProc(statFile)
|
filename := common.HostProc(statFile)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user