1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

tempDir (in the root dir), must be created after the root dir.

Signed-off-by: mikael.davranche <mikael.davranche@corp.ovh.net>
This commit is contained in:
root 2015-06-23 14:53:18 +02:00
parent 57aa0248af
commit 41f69883d2

View file

@ -608,17 +608,6 @@ func NewDaemon(config *Config, registryService *registry.Service) (daemon *Daemo
// set up SIGUSR1 handler to dump Go routine stacks // set up SIGUSR1 handler to dump Go routine stacks
setupSigusr1Trap() setupSigusr1Trap()
// set up the tmpDir to use a canonical path
tmp, err := tempDir(config.Root)
if err != nil {
return nil, fmt.Errorf("Unable to get the TempDir under %s: %s", config.Root, err)
}
realTmp, err := fileutils.ReadSymlinkedDirectory(tmp)
if err != nil {
return nil, fmt.Errorf("Unable to get the full path to the TempDir (%s): %s", tmp, err)
}
os.Setenv("TMPDIR", realTmp)
// get the canonical path to the Docker root directory // get the canonical path to the Docker root directory
var realRoot string var realRoot string
if _, err := os.Stat(config.Root); err != nil && os.IsNotExist(err) { if _, err := os.Stat(config.Root); err != nil && os.IsNotExist(err) {
@ -635,6 +624,17 @@ func NewDaemon(config *Config, registryService *registry.Service) (daemon *Daemo
return nil, err return nil, err
} }
// set up the tmpDir to use a canonical path
tmp, err := tempDir(config.Root)
if err != nil {
return nil, fmt.Errorf("Unable to get the TempDir under %s: %s", config.Root, err)
}
realTmp, err := fileutils.ReadSymlinkedDirectory(tmp)
if err != nil {
return nil, fmt.Errorf("Unable to get the full path to the TempDir (%s): %s", tmp, err)
}
os.Setenv("TMPDIR", realTmp)
// Set the default driver // Set the default driver
graphdriver.DefaultDriver = config.GraphDriver graphdriver.DefaultDriver = config.GraphDriver