Systemd.Signal (systemd v0.1.0)

Copy Markdown View Source

Helpers for receiving systemd D-Bus signals.

Summary

Functions

Waits for a JobRemoved signal matching a job object path.

Subscribes the current process to systemd manager signals.

Removes a signal subscription returned by subscribe_manager/1.

Types

job_removed()

@type job_removed() :: %{
  id: non_neg_integer(),
  job_path: String.t(),
  unit: String.t(),
  result: String.t()
}

subscription()

@type subscription() :: %Systemd.Signal{
  conn: pid(),
  match_rule: String.t(),
  ref: reference()
}

Functions

await_job_removed(signal, job_path, opts \\ [])

@spec await_job_removed(subscription(), String.t(), keyword()) ::
  {:ok, job_removed()} | {:error, Systemd.Error.t()}

Waits for a JobRemoved signal matching a job object path.

subscribe_manager(conn)

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

Subscribes the current process to systemd manager signals.

unsubscribe(signal)

@spec unsubscribe(subscription()) :: :ok | {:error, Systemd.Error.t()}

Removes a signal subscription returned by subscribe_manager/1.