|
|
@ -388,28 +388,30 @@ func serverMain(c *cli.Context) { |
|
|
|
return exitSuccess |
|
|
|
return exitSuccess |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
// Prints the formatted startup message.
|
|
|
|
|
|
|
|
printStartupMessage(endPoints) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Start server.
|
|
|
|
// Start server.
|
|
|
|
// Configure TLS if certs are available.
|
|
|
|
// Configure TLS if certs are available.
|
|
|
|
wait := make(chan struct{}, 1) |
|
|
|
wait := make(chan struct{}, 1) |
|
|
|
go func(tls bool, wait chan<- struct{}) { |
|
|
|
go func(tls bool, wait chan<- struct{}) { |
|
|
|
if tls { |
|
|
|
fatalIf(func() error { |
|
|
|
err = apiServer.ListenAndServeTLS(mustGetCertFile(), mustGetKeyFile()) |
|
|
|
defer func() { |
|
|
|
} else { |
|
|
|
wait <- struct{}{} |
|
|
|
// Fallback to http.
|
|
|
|
}() |
|
|
|
err = apiServer.ListenAndServe() |
|
|
|
if tls { |
|
|
|
} |
|
|
|
return apiServer.ListenAndServeTLS(mustGetCertFile(), mustGetKeyFile()) |
|
|
|
wait <- struct{}{} |
|
|
|
} // Fallback to http.
|
|
|
|
|
|
|
|
return apiServer.ListenAndServe() |
|
|
|
|
|
|
|
}(), "Failed to start minio server.") |
|
|
|
}(tls, wait) |
|
|
|
}(tls, wait) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Wait for formatting of disks.
|
|
|
|
err = formatDisks(disks, ignoredDisks) |
|
|
|
err = formatDisks(disks, ignoredDisks) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
// FIXME: call graceful exit
|
|
|
|
// FIXME: call graceful exit
|
|
|
|
errorIf(err, "formatting storage disks failed") |
|
|
|
errorIf(err, "formatting storage disks failed") |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Once formatted, initialize object layer.
|
|
|
|
newObject, err := newObjectLayer(disks, ignoredDisks) |
|
|
|
newObject, err := newObjectLayer(disks, ignoredDisks) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
// FIXME: call graceful exit
|
|
|
|
// FIXME: call graceful exit
|
|
|
@ -417,12 +419,13 @@ func serverMain(c *cli.Context) { |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
printEventNotifiers() |
|
|
|
// Prints the formatted startup message.
|
|
|
|
|
|
|
|
printStartupMessage(endPoints) |
|
|
|
|
|
|
|
|
|
|
|
objLayerMutex.Lock() |
|
|
|
objLayerMutex.Lock() |
|
|
|
globalObjectAPI = newObject |
|
|
|
globalObjectAPI = newObject |
|
|
|
objLayerMutex.Unlock() |
|
|
|
objLayerMutex.Unlock() |
|
|
|
<-wait |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fatalIf(err, "Failed to start minio server.") |
|
|
|
// Waits on the server.
|
|
|
|
|
|
|
|
<-wait |
|
|
|
} |
|
|
|
} |
|
|
|