Skip to content

io.systemd.Shutdown

APIs for shutting down or rebooting the system.

Property Value
Go package github.com/rossedman/sdvarlink/systemd/latest/shutdown
Socket /run/systemd/io.systemd.Shutdown
Available since systemd v262
Methods · types · errors 5 · 0 · 2

Methods

PowerOff

Power off the system

func (c *Client) PowerOff(ctx context.Context, in PowerOffIn) error

Parameters

Field Type Description
allowInteractiveAuthentication ?bool Controls whether interactive authentication (via polkit) shall be allowed. If unspecified defaults to false.
skipInhibitors ?bool Skip active inhibitors and force the operation

Reboot

Reboot the system

func (c *Client) Reboot(ctx context.Context, in RebootIn) error

Parameters

Field Type Description
allowInteractiveAuthentication ?bool Controls whether interactive authentication (via polkit) shall be allowed. If unspecified defaults to false.
skipInhibitors ?bool Skip active inhibitors and force the operation

Halt

Halt the system

func (c *Client) Halt(ctx context.Context, in HaltIn) error

Parameters

Field Type Description
allowInteractiveAuthentication ?bool Controls whether interactive authentication (via polkit) shall be allowed. If unspecified defaults to false.
skipInhibitors ?bool Skip active inhibitors and force the operation

KExec

Reboot the system via kexec

func (c *Client) KExec(ctx context.Context, in KExecIn) error

Parameters

Field Type Description
allowInteractiveAuthentication ?bool Controls whether interactive authentication (via polkit) shall be allowed. If unspecified defaults to false.
skipInhibitors ?bool Skip active inhibitors and force the operation

SoftReboot

Reboot userspace only

func (c *Client) SoftReboot(ctx context.Context, in SoftRebootIn) error

Parameters

Field Type Description
allowInteractiveAuthentication ?bool Controls whether interactive authentication (via polkit) shall be allowed. If unspecified defaults to false.
skipInhibitors ?bool Skip active inhibitors and force the operation

Errors

Error Go type Description
AlreadyInProgress AlreadyInProgressError Another shutdown or sleep operation is already in progress
BlockedByInhibitor BlockedByInhibitorError Operation denied due to active block inhibitor