7.7 The Job View

The job view is the shape every successful response on this channel carries, and the shape job-status and job-list return on the control channel (§4.14). It is defined once, here.

{
    "id": "0190a3b2-…",
    "type": "submitted",
    "state": "running",
    "cause": null,
    "submitter": "S-1-5-80-…",
    "identity": "S-1-5-21-…",
    "logon_session": 1042,
    "description": "Backup of docs",
    "image_path": "/usr/bin/peios-backup",
    "pid": 4521,
    "ready": null,
    "exit_code": null,
    "exit_signal": null,
    "status_text": "Backing up /home/u/docs (3/5)",
    "progress": {"current": 812, "total": 2048, "bounded": true,
                 "unit": "items"},
    "created_at": "2026-06-01T12:34:56.123456789Z",
    "started_at": "2026-06-01T12:34:56.223456789Z",
    "ended_at": null
}
FieldTypeMeaning
idstringThe job's identifier.
typestringAlways submitted on this channel. §4.B
statestring§7.B.
causestring or nullWhy the job ended, where the manager decided it. §7.B
submitterstringThe submitter's user SID.
identitystringThe job identity's user SID.
logon_sessionintegerThe job identity's logon session identifier.
descriptionstringAs submitted.
image_pathstringAs submitted.
pidinteger or nullThe process identifier, while there is a process.
readybool or nullFor a notify job: whether READY=1 has arrived. Null for a none job.
exit_codeinteger or nullThe exit code, when the process exited.
exit_signalinteger or nullThe signal, when the process was killed.
status_textstring or nullThe most recent STATUS the job sent (§4.19).
progressobject or nullThe most recent progress the job sent (§4.19).
created_atstringWhen the record was created. §4.5
started_atstring or nullWhen exec was confirmed.
ended_atstring or nullWhen the job became terminal.

A field that does not apply MUST be present and null, never omitted.

identity and submitter are user SIDs. A client that needs the identity's groups, privileges or integrity does not get them here; they are the job's, not the view's.

progress carries current (integer), total (integer or null), bounded (bool) and unit (string or null), in the representation §4.19 defines. A progress object whose total is null is either unbounded or not yet bounded, and bounded distinguishes them.

7.7.1 States #

StateProcess?Terminal?Meaning
createdNot yetNoThe record exists; exec has not been confirmed. Never visible on this channel — a submit is answered only after leaving it.
runningYesNoExec succeeded and the process is alive.
completedNoYesThe process exited with 0 or a code in success_exit_codes.
failedNoYesThe process exited otherwise, was killed by a signal, or never ran because setup failed.
abandonedYes, unkillablyYesThe process survived the kill. The manager has stopped supervising it.

These are the states of every job the manager runs, not a set invented for this channel; a client that understands them for a service's main job understands them here. A stopped job whose process died to the termination signal is failed with exit_signal set, and cause says the stop was asked for.

Which fields are populated is a function of state, and a client MAY rely on it:

Statepidstarted_atended_atexit_code / exit_signal
runningsetsetnullnull
completednullsetsetexactly one set
failed, process rannullsetsetexactly one set
failed, setup failednullnullsetboth null
abandonedsetsetsetboth null

exit_code and exit_signal are never both set: a process exits or is killed. For abandoned, ended_at records when supervision stopped; nothing exited.

7.7.2 Causes #

cause is set when the manager itself brought the job to its end, or decided it could not start, and null when the process ended of its own accord — a clean exit, a crash, a signal from elsewhere.

ValueStateMeaning
parent_setup_failurefailedThe manager could not prepare the launch: no token, no cgroup, no fork. No process existed.
pre_exec_failurefailedThe child's setup between fork and exec failed, or exec itself did.
readiness_timeoutfailedA notify job did not send READY=1 within readiness_timeout. The manager stopped it.
timeoutfailedThe job ran longer than timeout. The manager stopped it.
explicit_stopfailedA stop or job-stop was issued and the process died to it.
shutdownfailedThe system was shutting down and the manager stopped it.
process_unkillableabandonedThe process survived the kill.

A stop whose process handled the termination signal and exited 0 produces completed with cause explicit_stop: the manager asked, the process agreed, and both facts are recorded.

7.7.3 Retention #

The manager MUST hold a terminal job's record for at least a grace period after it reaches a terminal state, so that a submitter polling for the outcome can retrieve it. The value a Peios service manager uses is in §7.A.

An identifier that never existed and one whose record has been dropped MUST both be answered UNKNOWN_JOB, and a submitter MUST NOT distinguish them (§4.14's rule for operations, applied to jobs).

A job that is terminal stops counting against its submitter's quota at once; its record's retention is for the submitter's benefit, not a cost to it.

Edit this page