2021-01-17 12:06:23 +00:00
|
|
|
package plugin
|
|
|
|
|
|
|
|
import (
|
2022-08-05 11:18:17 +00:00
|
|
|
"io"
|
2021-01-17 12:06:23 +00:00
|
|
|
"os"
|
|
|
|
)
|
|
|
|
|
2022-04-24 12:37:52 +00:00
|
|
|
const (
|
|
|
|
dockerExe = "/usr/local/bin/docker"
|
|
|
|
dockerdExe = "/usr/local/bin/dockerd"
|
|
|
|
dockerHome = "/root/.docker/"
|
|
|
|
)
|
2021-01-17 12:06:23 +00:00
|
|
|
|
|
|
|
func (p Plugin) startDaemon() {
|
|
|
|
cmd := commandDaemon(p.settings.Daemon)
|
|
|
|
if p.settings.Daemon.Debug {
|
|
|
|
cmd.Stdout = os.Stdout
|
|
|
|
cmd.Stderr = os.Stderr
|
|
|
|
} else {
|
2022-08-05 11:18:17 +00:00
|
|
|
cmd.Stdout = io.Discard
|
|
|
|
cmd.Stderr = io.Discard
|
2021-01-17 12:06:23 +00:00
|
|
|
}
|
|
|
|
go func() {
|
|
|
|
trace(cmd)
|
2022-04-25 19:09:59 +00:00
|
|
|
_ = cmd.Run()
|
2021-01-17 12:06:23 +00:00
|
|
|
}()
|
|
|
|
}
|