Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ExeName string ExePath string ExeDirectory string )
Functions ¶
func GetDefaultShell ¶
func GetDefaultShell() []string
func RestartSelf ¶ added in v1.2.0
func RestartSelf() error
Types ¶
type CommandConfig ¶
type CommandResult ¶ added in v1.4.0
type CommandResult struct { Stdout []byte `json:"stdout"` Stderr []byte `json:"stderr"` Code int `json:"code"` }
func RunCommand ¶
func RunCommand(cfg CommandConfig) (CommandResult, error)
RunCommand runs a specified command, if Detached is true the command result will be empty
type InstanceLock ¶
type InstanceLock struct {
// contains filtered or unexported fields
}
func LockAndKill ¶
func LockAndKill() *InstanceLock
func NewInstanceLock ¶
func NewInstanceLock() InstanceLock
func (InstanceLock) KillLockedPid ¶
func (l InstanceLock) KillLockedPid() error
KillLockedPid kills the process with the pid in the lock file
func (InstanceLock) Lock ¶
func (l InstanceLock) Lock() error
Lock writes the current process id to the lock file
func (InstanceLock) LockedPid ¶
func (l InstanceLock) LockedPid() (int, error)
LockedPid returns the pid in the lock file
func (InstanceLock) LockedProcess ¶
func (l InstanceLock) LockedProcess() (*process.Process, int, error)
LockedProcess returns the process with the pid in the lock file can return os.ErrNotExist or process.ErrorProcessNotRunning
Click to show internal directories.
Click to hide internal directories.