Restart Kraft without ending running agents
The server restarts, the items you paused pick up where they stopped, and
kraft view list --all --status=active lists them again: no agent was ended.
You get there by pausing the running items first and resuming them afterwards.
A restart ends running agents
Stopping Kraft stops every agent it is running. That holds for
kraft admin stop, kraft admin restart,
kraft admin update --restart, and a restart of the
service.
When Kraft starts again, each item whose agent was running stops with
reattach: running session, PID identity unconfirmed, no result (pid N is not alive),
and the board shows it as failed. An item that a restart already stopped needs
only kraft item retry ID.
kraft admin restart and kraft admin update --restart list the active items
first and, in a terminal, ask before going on (-y skips the question).
kraft admin stop only lists them.
Restart without ending an agent
To restart without ending an agent, restart when nothing is running, or pause the running items first and resume them afterwards:
- List the items that may have an agent running:
kraft view list --all --status=active - Pause each of them:
kraft item pause ID. - Restart the server:
kraft admin restart, orkraft admin update --restartwhen you are also updating. Updating from 1.4 is the exception: use neitherupdatenorupdate --restart.kraft admin updateruns in the release you have installed, so it would run 1.4'supdate --restart, which neither lists the running items nor asks. Follow Update from 1.4 instead.kraft admin restartstops the server and starts it again. For a server started with--detach, it prints:kraft: stopped (pid 48213) kraft: http://127.0.0.1:8765 (pid 48390, detached - kraft admin stop)
When Kraft runs as a service, it printskraft: restarted the service. A server running in a terminal only stops: it printskraft: was running attached to a terminal - start it again there: kraftand exits 1. - Resume each item you paused:
kraft item resume ID.
Check it worked
kraft view list --all --status=active lists the items you resumed.
Next steps
- Environment variables: the variables that locate an instance.
- Admin verbs: every
kraft admincommand and its flags. - Troubleshooting: why an item stopped, and what to do.
Put a proxy in front of Kraft
Let a tunnel or reverse proxy on this machine pass webhooks and scripts to a loopback-bound Kraft by sending Host localhost, and check that nobody gets in without signing in.
Back up and restore the database
Back up Kraft's database while the server runs, check the backup, restore it, and find the copy Kraft makes before an upgrade.