Windows: Calculate PID file after root

Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 7453d028daaba786b7eaa55ce739e24becd09a33
Component: engine
This commit is contained in:
John Howard
2016-10-17 11:48:51 -07:00
parent 4f9853e826
commit 874ddf88be
2 changed files with 10 additions and 2 deletions

View File

@ -3,6 +3,8 @@ package main
import (
"fmt"
"os"
"path/filepath"
"runtime"
"github.com/Sirupsen/logrus"
"github.com/docker/docker/cli"
@ -61,6 +63,11 @@ func runDaemon(opts daemonOptions) error {
daemonCli := NewDaemonCli()
// On Windows, if there's no explicit pidfile set, set to under the daemon root
if runtime.GOOS == "windows" && opts.daemonConfig.Pidfile == "" {
opts.daemonConfig.Pidfile = filepath.Join(opts.daemonConfig.Root, "docker.pid")
}
// On Windows, this may be launching as a service or with an option to
// register the service.
stop, err := initService(daemonCli)