Skip to content
filterfish edited this page Apr 6, 2015 · 4 revisions

Smith requires some level of configuration and uses either a config file or environment variables to provide this. It has defaults for all variables apart from agent_directories and acl_directories which must be specified. There are only four environment variables so if a more elaborate configuration is required a config file will have to be supplied.

Smith searches for a config file in the following places:

./.smithrc $HOME/.smithrc /etc/smithrc /etc/smith/smithrc

The config is written using toml and the full list of config parameters are shown below. I have included an example of a minimal config such that might be suitable for dev (if the defaults aren't appropriate).

In addition to the config the following parameters can be set using environment variables:

  • SMITH_PID_DIRECTORY
  • SMITH_CACHE_DIRECTORY
  • SMITH_ACL_DIRECTORIES
  • SMITH_AGENT_DIRECTORIES

The environment variables (in case it's not obvious) are the upper case version of the config parameter prefixed with SMITH_.

Full example

[smith]
timeout = 8
namespace = "smith"

[agent]
monitor = false
singleton = true
metadata = ""
prefetch = 2

# Specify the VM that an agent should use.
[vm]
agent_default = "ruby"

[eventmachine]
epoll = true
kqueue = false

[agency]
# The the agency pid path. This can be overridden on the command line.
pid_directory = "/run/smith"
cache_directory = "/var/cache/smith"
agent_directories = "~/dev/ruby/smith2/agents"
acl_directories = "~/dev/ruby/acls"

# Change according to your local broker.
[amqp.broker]
host = "localhost"
port = 5672
user = "guest"
password = "guest"
vhost = "/"

[logging]
trace = true
level = "debug"

# Log pattern. Note you need to escape backslashes.
default_pattern = "%d [%5p] %7l - %34c:%-3L - %m\n"
default_date_pattern = "%Y/%m/%d %H:%M:%S.%3N"

# This can be either: stderr, stdout, file, rollingfile or syslog
[logging.appender]
type      = "stderr"

# filename = "/var/log/smith/smith.log"
# type      = "RollingFile"
# age       = "daily"
# keep      = 100

# type        syslog
# facility    128

# vim: ft=toml

Concise Example

[agency]
acl_directories = "~/dev/ruby/acls"
agent_directories = "~/dev/ruby/smith2/agents"

The rest of the config will be take from $gem_root/config/smithrc.toml.

Clone this wiki locally