RELOAD CONFIGURATION WITHOUT RESTART
This guide shows you how to reload pulled extensions, refresh the trusted
collectives list and change serve.yaml settings on a running swamp serve
without restarting the process.
Choose how to reload
swamp serve reload --server <url> reloads any server and prints what the
reload applied. You must be an admin. See
Reload on a remote server.
swamp serve reload without --server sends SIGHUP through the PID file,
.swamp/serve.pid. A server writes that file when it is not attached to a
terminal, such as a daemon, a container or a systemd service, or when it was
started with --hot-reload. A server in a terminal without --hot-reload
treats SIGHUP as shutdown, so reload it with --server.
Pull the updated extension
swamp extension pull @name/extension --forceUse --force to overwrite the existing bundle if the extension is already
installed.
Trigger the reload
swamp serve reloadThe server reloads all pulled extension bundles and refreshes the trust list. Subsequent requests use the updated code.
Refresh the trusted collectives list
swamp extension trust add @acmeswamp serve reloadThe server re-reads .swamp.yaml and picks up the updated trust list.
Extensions from newly trusted collectives are available for auto-resolution on
subsequent requests.
Change a serve setting
Edit .swamp/serve.yaml, for example to raise the run limit:
max-concurrent-runs: 20Reload, and read the report:
swamp serve reload --server wss://swamp.acme.internal:9090The report lists each changed setting as applied, needing a restart (with the reason), or overridden by the startup flag or environment variable that pins it. If the file fails startup's checks, nothing in it is applied and the command exits 1. See What reload changes for every setting.
A local swamp serve reload does not print the report; the server log lists
what the reload applied.
Reload on a remote server
Pass --server to send the reload request over WebSocket instead of using the
local PID file:
swamp serve reload --server wss://swamp.acme.internal:9090If the server requires authentication, provide a token:
swamp serve reload --server wss://swamp.acme.internal:9090 \
--token 'paul-token.<secret>'To avoid repeating --server on every command, set SWAMP_SERVE_URL:
export SWAMP_SERVE_URL=wss://swamp.acme.internal:9090
swamp serve reloadStored credentials from swamp auth server-login are used automatically.
Related
- Hot Reload — full reference for reload, the settings it applies and the reload report
- Serve Flags — all
swamp serveflags