Systemd.Job (systemdkit v0.1.2)

Copy Markdown View Source

A systemd job returned by manager operations such as StartUnit.

Summary

Functions

Polls until a job leaves waiting/running or disappears from the bus.

Waits for this job's JobRemoved D-Bus signal.

Cancels this job through its D-Bus object.

Reads a job property.

Reads and normalizes the job state.

Types

state()

@type state() :: :waiting | :running | :done | :unknown

t()

@type t() :: %Systemd.Job{object_path: String.t()}

Functions

await(conn, job, opts \\ [])

@spec await(pid(), t(), keyword()) :: :ok | {:error, Systemd.Error.t()}

Polls until a job leaves waiting/running or disappears from the bus.

await_signal(conn, job, opts \\ [])

@spec await_signal(pid(), t(), keyword()) :: :ok | {:error, Systemd.Error.t()}

Waits for this job's JobRemoved D-Bus signal.

cancel(conn, job)

@spec cancel(pid(), t()) :: :ok | {:error, Systemd.Error.t()}

Cancels this job through its D-Bus object.

property(conn, job, property)

@spec property(pid(), t(), String.t()) :: {:ok, term()} | {:error, Systemd.Error.t()}

Reads a job property.

state(conn, job)

@spec state(pid(), t()) :: {:ok, state()} | {:error, Systemd.Error.t()}

Reads and normalizes the job state.