osutil

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HardReboot

func HardReboot(logger log.Logger) error

HardReboot will try to sync file-system data and then issues a reboot system call. It will not block indefinitely on syncing. It doesn't depend on a working "reboot" programme. This is a reboot of last resort.

func RunCommand

func RunCommand(logger log.Logger, name string, args ...string) bool

RunCommand will run a command, returning true on success. If there is an error, a message is logged and false is returned. The name of the command to run must be specified by name.

func RunCommandBackground

func RunCommandBackground(logger log.Logger, name string,
	args ...string) <-chan struct{}

RunCommandBackground will run a command in a goroutine and returns a channel that will receive a message if the command fails. No message is received if the command succeeds. Errors are logged. This is useful for commands that start asynchronous work where you will wait for completion but want failures to trigger a cancellation on waiting.

func SyncTimeout added in v0.8.0

func SyncTimeout(timeout time.Duration) error

SyncTimeout will try to sync file-system data and then waits up to the specified timeout for it to complete. It returns an error on failure/timeout.

Types

This section is empty.

Jump to

Keyboard shortcuts

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