Documentation
¶
Index ¶
Constants ¶
View Source
const DaemonLog = "daemon.log"
View Source
const EnvDaemonIdx = "XW_DAEMON_IDX"
View Source
const MaxCount = 5
Variables ¶
This section is empty.
Functions ¶
func Background ¶
Turn the the main program into background running (start a child process, and then exit) logFile - If it is not empty, the standard output and error output of the child process will be recorded in this file isExit - Whether to exit the main program directly after the child process started. If false, the main program returns * OS Process, the child process returns nil. It needs to be handled by the caller.
func NewSysProcAttr ¶
func NewSysProcAttr() *syscall.SysProcAttr
Types ¶
type Daemon ¶
type Daemon struct {
// records the standard output and error output of daemons and child processes
LogFile string
// The maximum number of cycle restarts. If it is 0, it will restart indefinitely
MaxCount int
// The maximum number of consecutive startup failures or abnormal exits.
// Exceed this number, the daemon exits and the child process will not be restarted
MaxError int
// The minimum time (in seconds) for a child process to exit normally
// Less than this time is considered as abnormal exit
MinExitTime int64
// validator key for daemon
ValidatorKey string
}
Daemon
Click to show internal directories.
Click to hide internal directories.