Documentation ¶
Index ¶
- Constants
- func ManageSignals(p *Process)
- func NewFileLogger(fName, prfx, lRotation string, statusChannel chan ProcessStatus) (*fileLogger, error)
- func Runner()
- func SetGateway(gateway string) error
- func SetUser(newUsername string) error
- type Config
- type Logger
- type Notifier
- type Process
- type ProcessStatus
Constants ¶
const EOL rune = 0x0A
const PROCESS_RUNNING int = 1
const PROCESS_STARTED int = 0
const PROCESS_STOPPED int = 2
const PSDOCK_CFG_FILEPATH string = "/etc/psdock/psdock.conf"
Variables ¶
This section is empty.
Functions ¶
func ManageSignals ¶
func ManageSignals(p *Process)
ManageSignals awaits for incoming signals and triggers a http request when one is received. Signals listened to are SIGINT, SIGQUIT, SIGTERM, SIGHUP, SIGALRM and SIGPIPE
func NewFileLogger ¶
func NewFileLogger(fName, prfx, lRotation string, statusChannel chan ProcessStatus) (*fileLogger, error)
func SetGateway ¶
SetNetwork sets the gateway of the container. It should only be called if psdock is used in "/sbin/init" mode
Types ¶
type Config ¶
type Config struct { Command string Args string Stdout string LogRotation string LogPrefix string LogColor string EnvVars string BindPort int WebHook string Stdin string UserName string Gateway string }
command is the name of the command to be executed by psdock Config contains the result of command-line-Config parsing. args are the Config passed to this command stdout is the redirection path for the stdout/stderr of the launched process logRotation is the lifetime (in seconds) of a single log file logPrefix is the prefix for logging the output of the launched process bindPort is the port watched for binding by psdock webHook is the hook triggered by psdock in case of special events user is the UID of the user launching the process
type Process ¶
type Process struct { Cmd *exec.Cmd Conf *Config Notif Notifier Pty *os.File StatusChannel chan ProcessStatus // contains filtered or unexported fields }
func NewProcess ¶
NewProcess creates a new struct of type *Process and returns its address
func (*Process) SetEnvVars ¶
func (p *Process) SetEnvVars()
SetEnvVars sets the environment variables for the launched process If p.Conf.EnvVars is empty, we pass all the current env vars to the child
type ProcessStatus ¶
type used to communicate between goroutines