Agent

Agent configuration

Shell user, proxies, files on disk and resource use.

Who the shell runs as

The agent runs as root. Shells and fleet commands run as the account that ran the installer through sudo, or as root when the installer ran as root (cloud-init, a provisioning script). Install with --shell-user ops to pick the account, or --shell-user root for root shells. The account keeps its groups, and sudo works if the account is allowed to use it. Fleet commands that need root (apt upgrade) then need sudo without a password, or a root shell user.

To change it later, set shell_user in the config and restart the agent:

# "ops" or any account; "root" for root shells
sudo python3 -c 'import json;p="/etc/fieldhand/agent.json";d=json.load(open(p));d["shell_user"]="ops";json.dump(d,open(p,"w"))'
sudo systemctl restart fieldhand

Networks with a proxy

The agent honours HTTPS_PROXY and NO_PROXY. With systemd:

sudo systemctl edit fieldhand
# add:
[Service]
Environment=HTTPS_PROXY=http://proxy.example:3128

sudo systemctl restart fieldhand

With OpenRC, add export HTTPS_PROXY=… to /etc/conf.d/fieldhand.

Files

PathContents
/usr/local/bin/fieldhandThe agent binary.
/etc/fieldhand/agent.jsonDevice ID and key, mode 0600. Treat it like an SSH private key.
/etc/systemd/system/fieldhand.servicesystemd unit (or /etc/init.d/fieldhand under OpenRC).
/var/log/fieldhand.logLog under OpenRC. Under systemd: journalctl -u fieldhand.

Resource use

Measured on a single-core amd64 machine: about 11 MB of RAM and no measurable CPU when idle. On machines with many cores the Go runtime keeps a little more per core. Under systemd the service is held to about 12 MB by the agent itself and has a low CPU weight. Shells and fleet commands get the memory they need.

Something wrong or missing on this page? Tell us.