func getDockerProcess(dockerPidFile string) (*procfs.Process, error) { pid, err := pidOfDocker(dockerPidFile) if err != nil || pid <= 0 { return nil, err } return procfs.NewProcess(pid, true) }
func readDockerDaemonArgs(dockerPidFile string) (succ bool, cmdLine []string, err error) { pid, err := pidOfDocker(dockerPidFile) if err != nil { // TODO: log error message return false, cmdLine, err } if pid <= 0 { // no pid was found, but not really an error return true, cmdLine, nil } process, err := procfs.NewProcess(pid, true) if err != nil { return false, cmdLine, err } cmdLine = process.Cmdline return true, cmdLine, nil }
func readDockerDaemonEnviron(dockerPidFile string) (succ bool, environ map[string]string, err error) { pid, err := pidOfDocker(dockerPidFile) if err != nil { // TODO: log error message return false, environ, err } if pid <= 0 { // no pid was found, but not really an error return true, environ, nil } process, err := procfs.NewProcess(pid, true) if err != nil { return false, environ, err } environ = process.Environ return true, environ, nil }