io.systemd.Job¶
Job management interface for the systemd service manager.
| Property | Value |
|---|---|
| Go package | github.com/rossedman/sdvarlink/systemd/latest/job |
| Socket | /run/systemd/io.systemd.Manager |
| Available since | systemd v262 |
| Methods · types · errors | 3 · 4 · 1 |
Methods¶
List¶
streaming optional
List queued jobs
func (c *Client) List(ctx context.Context, in ListIn) (*ListOut, error)
func (c *Client) ListMore(ctx context.Context, in ListIn) iter.Seq2[*ListOut, error]
Parameters
| Field | Type | Description |
|---|---|---|
id |
?int |
If non-null, filter by job ID |
unit |
?string |
If non-null, filter by unit name |
Reply
| Field | Type | Description |
|---|---|---|
Id |
int |
The numeric job ID |
Unit |
?string |
The unit name this job operates on |
JobType |
JobType |
The job type |
State |
?JobState |
Current job state. 'finished' indicates the job has completed; in that case Result is also set. |
Result |
?JobResult |
Job result. Only set once the job has reached the 'finished' state. |
ActivationDetails |
?[string]string |
Activation details describing what triggered this job, as key-value pairs |
Cancel¶
Cancel a specific job
Parameters
| Field | Type | Description |
|---|---|---|
id |
int |
The job ID to cancel |
ClearAll¶
Cancel all pending jobs
Types¶
JobType¶
Job type
| Value | Description |
|---|---|
start |
|
verify_active |
|
stop |
|
reload |
|
reload_or_start |
|
restart |
|
try_restart |
|
try_reload |
|
nop |
JobState¶
Job state
| Value | Description |
|---|---|
waiting |
|
running |
|
finished |
JobResult¶
Job result
| Value | Description |
|---|---|
done |
|
canceled |
|
timeout |
|
failed |
|
dependency |
|
skipped |
|
invalid |
|
assert |
|
unsupported |
|
collected |
|
once |
|
frozen |
|
concurrency |
Job¶
A job object
| Field | Type | Description |
|---|---|---|
Id |
int |
The numeric job ID |
Unit |
?string |
The unit name this job operates on |
JobType |
JobType |
The job type |
State |
?JobState |
Current job state. 'finished' indicates the job has completed; in that case Result is also set. |
Result |
?JobResult |
Job result. Only set once the job has reached the 'finished' state. |
ActivationDetails |
?[string]string |
Activation details describing what triggered this job, as key-value pairs |
Errors¶
| Error | Go type | Description |
|---|---|---|
NoSuchJob |
NoSuchJobError |
The specified job does not exist |