command

package
v0.17.4 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2026 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exists

func Exists(cmd string) bool

func ExistsForUser

func ExistsForUser(cmd, user string) bool

func ForUser added in v0.9.0

func ForUser(cmd *exec.Cmd, userName string) error

func GetHome

func GetHome(userName string) (string, error)

func IsRunning

func IsRunning(pid string) (bool, error)

func Kill

func Kill(pid string) error

func Quote

func Quote(args []string) string

func StartBackgroundOnce added in v0.17.2

func StartBackgroundOnce(commandName string, createCommand CreateCommand) error

StartBackgroundOnce starts a background process, ensuring only one instance with the given commandName runs at a time. If a process is already running (determined by PID file), or the lock cannot be acquired, it returns nil.

Process output is redirected to TMPDIR/commandName.streams unless the command already has Stdout/Stderr configured. The PID is recorded in TMPDIR/commandName.pid. These files are not cleaned up on exit.

func WrapCommandError

func WrapCommandError(stdout []byte, err error) error

Types

type CreateCommand added in v0.17.2

type CreateCommand func() (*exec.Cmd, error)

type Error

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

func (*Error) Error

func (e *Error) Error() string

Jump to

Keyboard shortcuts

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