Files
docker-cli/components/engine/pkg/systemd/booted.go
Alexander Larsson a2c3f01761 Add systemd.SdBooted()
This is a conversion of sd_booted() from libsystemd to go and checks
if the system was booted with systemd.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: 1296d5ce9ad43d8d833f6e5661da45aef6d4c26b
Component: engine
2014-03-27 22:44:31 +01:00

16 lines
201 B
Go

package systemd
import (
"os"
)
// Conversion to Go of systemd's sd_booted()
func SdBooted() bool {
s, err := os.Stat("/run/systemd/system")
if err != nil {
return false
}
return s.IsDir()
}