Systemd.Manager (systemd v0.1.0-pre.1)

Copy Markdown View Source

Client for org.freedesktop.systemd1.Manager.

Summary

Functions

Connects to the system bus.

Gets the D-Bus object path for a loaded unit.

Links unit files into systemd's search path.

Lists currently loaded systemd units.

Reloads systemd manager configuration (daemon-reload).

Reloads a unit and returns the queued systemd job.

Restarts a unit and returns the queued systemd job.

Starts a transient unit and returns the queued systemd job.

Starts a unit and returns the queued systemd job.

Stops a unit and returns the queued systemd job.

Functions

connect(opts \\ [])

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

Connects to the system bus.

disable_unit_files(conn, files, opts \\ [])

@spec disable_unit_files(pid(), [String.t()], keyword()) ::
  {:ok, Systemd.UnitFileOperation.t()} | {:error, Systemd.Error.t()}

Disables unit files.

enable_unit_files(conn, files, opts \\ [])

@spec enable_unit_files(pid(), [String.t()], keyword()) ::
  {:ok, Systemd.UnitFileOperation.t()} | {:error, Systemd.Error.t()}

Enables unit files.

get_unit(conn, unit_name)

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

Gets the D-Bus object path for a loaded unit.

list_units(conn_or_opts \\ [])

@spec list_units(pid() | keyword()) ::
  {:ok, [Systemd.Unit.t()]} | {:error, Systemd.Error.t()}

Lists currently loaded systemd units.

Accepts either an existing D-Bus connection PID or connection options. Passing options opens a short-lived connection.

mask_unit_files(conn, files, opts \\ [])

@spec mask_unit_files(pid(), [String.t()], keyword()) ::
  {:ok, Systemd.UnitFileOperation.t()} | {:error, Systemd.Error.t()}

Masks unit files.

reload(conn)

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

Reloads systemd manager configuration (daemon-reload).

reload_unit(conn, unit_name, opts \\ [])

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

Reloads a unit and returns the queued systemd job.

restart_unit(conn, unit_name, opts \\ [])

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

Restarts a unit and returns the queued systemd job.

start_transient_unit(conn, unit_name, properties, opts \\ [])

@spec start_transient_unit(
  pid(),
  String.t(),
  [Systemd.TransientUnit.Property.t()],
  keyword()
) ::
  {:ok, Systemd.Job.t()} | {:error, Systemd.Error.t()}

Starts a transient unit and returns the queued systemd job.

start_unit(conn, unit_name, opts \\ [])

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

Starts a unit and returns the queued systemd job.

stop_unit(conn, unit_name, opts \\ [])

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

Stops a unit and returns the queued systemd job.

unmask_unit_files(conn, files, opts \\ [])

@spec unmask_unit_files(pid(), [String.t()], keyword()) ::
  {:ok, Systemd.UnitFileOperation.t()} | {:error, Systemd.Error.t()}

Unmasks unit files.