Documentation
¶
Index ¶
- func Exists(cmd string) bool
- func ExistsForUser(cmd, user string) bool
- func ForUser(cmd *exec.Cmd, userName string) error
- func GetHome(userName string) (string, error)
- func IsRunning(pid string) (bool, error)
- func Kill(pid string) error
- func Quote(args []string) string
- func StartBackgroundOnce(commandName string, createCommand CreateCommand) error
- func WrapCommandError(stdout []byte, err error) error
- type CreateCommand
- type Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExistsForUser ¶
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 ¶
Types ¶
type CreateCommand ¶ added in v0.17.2
Click to show internal directories.
Click to hide internal directories.