mirror of
https://github.com/status-im/consul.git
synced 2025-02-19 17:14:37 +00:00
check if data-dir is actually a directory
This commit is contained in:
parent
4ed6770cfa
commit
8daa45c5b4
@ -209,6 +209,12 @@ func (c *Command) readConfig() *Config {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if finfo, _ := os.Stat(config.DataDir); !finfo.IsDir() {
|
||||||
|
c.Ui.Error(fmt.Sprintf("CRITICAL: The data-dir specified at %q is not a directory", config.DataDir))
|
||||||
|
c.Ui.Error("Consul will refuse to boot without a valid data directory")
|
||||||
|
c.Ui.Error("Please provide a valid directory and try starting again.")
|
||||||
|
}
|
||||||
|
|
||||||
// Ensure all endpoints are unique
|
// Ensure all endpoints are unique
|
||||||
if err := config.verifyUniqueListeners(); err != nil {
|
if err := config.verifyUniqueListeners(); err != nil {
|
||||||
c.Ui.Error(fmt.Sprintf("All listening endpoints must be unique: %s", err))
|
c.Ui.Error(fmt.Sprintf("All listening endpoints must be unique: %s", err))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user