reboot

package
v0.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package reboot provides a function to reboot the system.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotRoot = errors.New("must be run as sudo/root")

Functions

func Reboot

func Reboot(ctx context.Context, opts ...OpOption) error

Reboots the system.

Types

type Op

type Op struct {
	// contains filtered or unexported fields
}

type OpOption

type OpOption func(*Op)

func WithDelaySeconds added in v0.0.5

func WithDelaySeconds(delaySeconds int) OpOption

Specifies the delay seconds before rebooting. Useful for the remote server to get the response from a GPUd daemon.

func WithSystemctl

func WithSystemctl(b bool) OpOption

Set true to run "systemctl reboot".

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL