common

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VarDirPath        = "/var/jobber"
	CmdSocketFileName = "cmd.sock"
)
View Source
const (
	DaemonSocketAddr string = "/var/jobber_daemon.sock"
)

Variables

View Source
var ErrLogger *log.Logger = log.New(os.Stderr, "", 0)
View Source
var Logger *log.Logger = log.New(os.Stdout, "", 0)

Functions

func AllUsersWithSockets added in v1.3.0

func AllUsersWithSockets() ([]*user.User, error)

Get a list of all users for whom there is a jobberrunner process.

func Chown added in v1.3.0

func Chown(path string, usr *user.User) error

func CmdSocketPath added in v1.3.0

func CmdSocketPath(usr *user.User) string

func ExecAndWait added in v1.3.0

func ExecAndWait(cmd *exec.Cmd, input *[]byte) (*ExecResult, *Error)

func FindLibexecProgram added in v1.3.0

func FindLibexecProgram(name string) (string, error)

func LogToStdoutStderr added in v1.3.0

func LogToStdoutStderr()

func LongVersionStr

func LongVersionStr() string

func MakeCmdExitedChan added in v1.3.0

func MakeCmdExitedChan(cmd *exec.Cmd) <-chan error

func PerUserDirPath added in v1.3.0

func PerUserDirPath(usr *user.User) string

func RunnerPidFilePath added in v1.3.0

func RunnerPidFilePath(usr *user.User) string

func SetLogFile added in v1.3.0

func SetLogFile(paths ...string)

func ShortVersionStr

func ShortVersionStr() string

func Sudo

func Sudo(usr user.User, cmdStr string) *exec.Cmd

Returns an unstarted process descriptor.

func UseSyslog added in v1.3.0

func UseSyslog() error

func UserOwnsFile added in v1.3.0

func UserOwnsFile(usr *user.User, path string) (bool, error)

func UserOwnsFileF added in v1.3.0

func UserOwnsFileF(usr *user.User, f *os.File) (bool, error)

Types

type Error

type Error struct {
	What  string
	Cause error
}

func (*Error) Error

func (e *Error) Error() string

type ExecResult added in v1.3.0

type ExecResult struct {
	Stdout    []byte
	Stderr    []byte
	Succeeded bool
}

Jump to

Keyboard shortcuts

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