|
| 1 | +.SH EXIT STATUS |
| 2 | +.TP |
| 3 | +.B 0 |
| 4 | +A scheduler is running normally, or no scheduler is running. Both |
| 5 | +states are reported with a clear message and exit zero. |
| 6 | +.TP |
| 7 | +.B 1 |
| 8 | +Generic error. The container runtime could not be queried, the |
| 9 | +.B \-\-output |
| 10 | +value is invalid, or another setup-level failure occurred. |
| 11 | +.TP |
| 12 | +.B 2 |
| 13 | +Discrepancy between schedctl's view and the kernel's view. The |
| 14 | +.B status |
| 15 | +field in the report identifies which kind of discrepancy was |
| 16 | +detected (see |
| 17 | +.B STATUS VALUES |
| 18 | +below). |
| 19 | +.SH STATUS VALUES |
| 20 | +The |
| 21 | +.B status |
| 22 | +field takes one of the following stable string values. These |
| 23 | +values are part of the JSON schema and will not be renamed without |
| 24 | +a schema version bump. |
| 25 | +.TP |
| 26 | +.B idle |
| 27 | +No managed scheduler and the kernel reports no attached ops. Exit 0. |
| 28 | +.TP |
| 29 | +.B running |
| 30 | +A managed scheduler is running and the kernel reports a matching |
| 31 | +attached ops. Exit 0. |
| 32 | +.TP |
| 33 | +.B orphaned-kernel-state |
| 34 | +The kernel reports a sched_ext ops attached, but schedctl is not |
| 35 | +managing any scheduler. Indicates a scheduler started outside |
| 36 | +schedctl, or schedctl-managed state was lost. Exit 2. |
| 37 | +.TP |
| 38 | +.B managed-detached |
| 39 | +schedctl is managing a scheduler container but the kernel reports |
| 40 | +no ops attached. Likely the container is running but has not |
| 41 | +attached its BPF program, or it crashed without cleaning up. Exit 2. |
| 42 | +.TP |
| 43 | +.B managed-mismatch |
| 44 | +schedctl is managing a scheduler container, the kernel reports |
| 45 | +a different ops attached than the one schedctl expected. Exit 2. |
| 46 | +.TP |
| 47 | +.B multiple-managed |
| 48 | +schedctl is managing more than one scheduler container. Only one |
| 49 | +sched_ext scheduler can be attached at a time. Exit 2. |
| 50 | +.SH JSON OUTPUT |
| 51 | +.B \-\-output json |
| 52 | +emits a single JSON document on stdout. The schema is versioned |
| 53 | +through the |
| 54 | +.B schema_version |
| 55 | +field; consumers should reject documents whose |
| 56 | +.B schema_version |
| 57 | +does not match a version they understand. |
| 58 | +.PP |
| 59 | +.B Top-level fields: |
| 60 | +.RS |
| 61 | +.TP |
| 62 | +.B schema_version |
| 63 | +String. The current value is |
| 64 | +.BR "1" . |
| 65 | +Bumped on any breaking change. |
| 66 | +.TP |
| 67 | +.B status |
| 68 | +String. One of the values listed under |
| 69 | +.BR "STATUS VALUES" . |
| 70 | +.TP |
| 71 | +.B driver |
| 72 | +String. The container runtime that was queried |
| 73 | +.RB ( podman |
| 74 | +or |
| 75 | +.BR containerd ). |
| 76 | +.TP |
| 77 | +.B scheduler |
| 78 | +Object. Present iff schedctl is managing exactly one scheduler. See |
| 79 | +.B "Scheduler object" |
| 80 | +below. Omitted otherwise. |
| 81 | +.TP |
| 82 | +.B kernel |
| 83 | +Object. Always present. See |
| 84 | +.B "Kernel object" |
| 85 | +below. |
| 86 | +.TP |
| 87 | +.B discrepancy |
| 88 | +String. Present iff |
| 89 | +.B status |
| 90 | +indicates a discrepancy. Carries a human-readable description. |
| 91 | +Omitted when |
| 92 | +.B status |
| 93 | +is |
| 94 | +.B idle |
| 95 | +or |
| 96 | +.BR running . |
| 97 | +.RE |
| 98 | +.PP |
| 99 | +.B Scheduler object: |
| 100 | +.RS |
| 101 | +.TP |
| 102 | +.B name |
| 103 | +String. The container/scheduler name as schedctl knows it |
| 104 | +(e.g. |
| 105 | +.IR scx_rusty ). |
| 106 | +.TP |
| 107 | +.B container_id |
| 108 | +String. The container ID assigned by the runtime. |
| 109 | +.TP |
| 110 | +.B image |
| 111 | +String. Image reference the container was started from. |
| 112 | +.TP |
| 113 | +.B image_id |
| 114 | +String. Image digest. Omitted when the runtime did not surface one. |
| 115 | +.TP |
| 116 | +.B pid |
| 117 | +Number. Host PID of the container's primary process. |
| 118 | +.TP |
| 119 | +.B started_at |
| 120 | +String, RFC 3339 timestamp in UTC. |
| 121 | +.RE |
| 122 | +.PP |
| 123 | +.B Kernel object: |
| 124 | +.RS |
| 125 | +.TP |
| 126 | +.B supported |
| 127 | +Boolean. |
| 128 | +.B true |
| 129 | +iff |
| 130 | +.I /sys/kernel/sched_ext |
| 131 | +exists. |
| 132 | +.TP |
| 133 | +.B enabled |
| 134 | +Boolean. |
| 135 | +.B true |
| 136 | +iff |
| 137 | +.I /sys/kernel/sched_ext/state |
| 138 | +reads as |
| 139 | +.IR enabled . |
| 140 | +.TP |
| 141 | +.B ops |
| 142 | +String. Contents of |
| 143 | +.IR /sys/kernel/sched_ext/root/ops , |
| 144 | +or the empty string when no ops are attached. |
| 145 | +.RE |
| 146 | +.SH EXAMPLES |
| 147 | +.PP |
| 148 | +Human-readable status: |
| 149 | +.PP |
| 150 | +.RS |
| 151 | +.nf |
| 152 | +$ schedctl status |
| 153 | +scheduler running: scx_rusty |
| 154 | + driver: podman |
| 155 | + container: 3a7f... |
| 156 | + image: ghcr.io/sched-ext/scx_rusty:latest |
| 157 | + digest: sha256:abcd... |
| 158 | + pid: 4242 |
| 159 | + started: 2026-05-02T10:30:00Z |
| 160 | + kernel: enabled, ops=rusty |
| 161 | +.fi |
| 162 | +.RE |
| 163 | +.PP |
| 164 | +JSON output for scripts: |
| 165 | +.PP |
| 166 | +.RS |
| 167 | +.nf |
| 168 | +$ schedctl status --output json | jq -r .status |
| 169 | +running |
| 170 | +.fi |
| 171 | +.RE |
| 172 | +.SH SEE ALSO |
| 173 | +.BR schedctl (1), |
| 174 | +.BR schedctl-run (1), |
| 175 | +.BR schedctl-stop (1) |
0 commit comments