What does `hab sup config orgin/package` display?

That is, does this command show us the running config or the default config of the package?

There is a hab pkg config <PKG_IDENT> command that will show the default configuration for the package. There isn’t currently a hab sup config <PKG_IDENT> command, though.

A bit confused by this then:

$ hab sup config core/redis
appendfsync = "everysec"
appendonly = "no"
bind = []
databases = 16
dbfilename = "dump.rdb"
logfile = "\"\""
loglevel = "notice"
min-slaves-max-lag = false
min-slaves-to-write = false
no-appendfsync-on-rewrite = "no"
port = 6379
protected-mode = "yes"
rbchecksum = "yes"
rbcompression = "yes"
repl-backlog-size = "1mb"
repl-backlog-ttl = "3600"
repl-disable-tcp-nodelay = "no"
repl-diskless-sync = "no"
repl-diskless-synx-delay = 5
repl-ping-slave-period = 10
repl-timeout = 60
requirepass = ""
slave-priority = "100"
slave-read-only = "yes"
slave-serve-stale-data = "yes"
stop-writes-on-bgsave-error = "yes"
tcp-backlog = 511
tcp-keepalive = 0
timeout = 0

[[save]]
keys = 1
sec = 900

[[save]]
keys = 10
sec = 300

[[save]]
keys = 10000
sec = 60

hab sup config <PKG_IDENT> shows the default configuration of the package.

$ sudo hab sup config learn/mongodb|grep bind_ip
  bind_ip = "127.0.0.1"

Whereas, the running service is bound to 0.0.0.0.

$ curl http://IP_ADDRESS:9631/services/mongodb/default/config | jq .mongod.net.bind_ip
  "0.0.0.0"

Gotcha. This seems a bit confusing since we already have hab pkg config which can give us the same information. In other words, I’d expect asking the Supervisor for a config to give me the running config.

Hrmm… I must have had something weird going on in my environment initially… I’m able to see that now :thinking:

There’s an issue to have a command that shows current config of a service group. It required the new sup to be merged in the repo (was the first issue I wanted to contribute :smiley: )

See: https://github.com/habitat-sh/habitat/issues/2551

1 Like