Skip to content

Determine why a process stopped

Every exit emits a topic that names the reason. You don’t need to inspect meta to know what happened:

TopicWhat it meansWill it restart?
xs.<kind>.<name>.fin.termUser appended termNo
xs.<kind>.<name>.fin.okSelf-terminated cleanly (actor returned no next; service script exited and isn’t auto-restarting)No
xs.<kind>.<name>.fin.errorRuntime crashNo
xs.<kind>.<name>.invalidScript failed to parse at create time (never started)No (and the previous good version is kept as the fallback)
xs.<kind>.<name>.replacedA newer create displaced itA new instance is starting now
xs.<kind>.<name>.stoppedxs is shutting down (xs.stopping)Yes, when xs starts back up

Quick recipes

”Did this service crash or did I stop it?”

Terminal window
.cat -T xs.service.api.* | where topic =~ "fin\\." | last 1

If you see fin.error, the script crashed; the meta.message field has the error text.

If you see fin.term, you (or some other appender) asked for the stop.

”Why isn’t my service running after a restart?”

Terminal window
.cat -T xs.service.api.* | last 5

Look for the most recent terminal frame:

  • An invalid means the latest create was broken; the fallback path may have started a previous good version (look for a more recent active).
  • A fin.term or fin.error means the service was deliberately taken down and won’t restart until you append a fresh create.
  • A stopped means xs shut down cleanly; the service will come back on the next start.
  • No terminal frame at all (just create followed by no active) means it’s still trying to start, or xs hasn’t replayed history yet.

”Was a process replaced, or did it crash and a successor was registered separately?”

  • replaced is the runtime telling you “the same <kind>.<name> got a newer create; this old instance stepped aside.” It’s emitted by the old instance.
  • A separate create with no replaced before it means there was no prior version running for that name.