* * adding cli config and config file support for specifying the serf wan and lan bind addresses
* updating documentation for serf wan and lan options
Fixes#2007
* Cleans up some small things from #2380.
* Uses the bind default for the agent test for Serf WAN and LAN.
In #2191 I accedentally broke SCADA by not populating the agent's version
information into the config structure. This adds it back, and makes the
distinction between the raw parts we send to APIs and the human form of
the version that we display.
When checkpoint emits a log message indicating an agent is out of
date, include the current version along with the available version
according to checkpoint.
Inspired by: log output in #993
IP sockets provide nice endpoints where the kernel will fail to bind and will error out saying socket already in use. UNIX sockets, however, don't enjoy this nice property when cleaning up stale sockets on listen. Given the number of addresses in Consul, provide operators with a helpful message that indicates the source of the reused address.
Before this fix, it was possible for the HTTP socket to unlink the RPC socket, leading to confusing blocked behavior when running commands like `consul info`.
```
% cat tmp.config.json
{
"addresses": {
"http": "unix:///tmp/.consul.sock",
"rpc": "unix:///tmp/.consul.sock"
},
"unix_sockets": {
"mode": "0700"
}
}
% consul agent -config-file tmp.config.json -advertise=127.0.0.1 -data-dir=/tmp/
==> All listening endpoints must be unique: HTTP address already configured for RPC
Exit 1
```
The `-dc` flag from the agent CLI command has been deprecated in favor of
`-datacenter`. This is done this way because:
- Other CLI commands used `-datacenter`. See: event, exec and watch.
- The agent configuration file uses `datacenter`.
Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
Consolidate code duplication and tests into a single lib package. Most of these functions were from various **/util.go functions that couldn't be imported due to cyclic imports. The consul/lib package is intended to be a terminal node in an import DAG and a place to stash various consul-only helper functions. Pulled in hashicorp/go-uuid instead of consolidating UUID access.