Documentation ¶
Index ¶
- type Daemon
- func (d *Daemon) Cleanup() error
- func (d *Daemon) Daemonize(workDir string, inFile io.Reader, outFile io.Writer, errFile io.Writer) error
- func (d *Daemon) Pid() (int, error)
- func (d *Daemon) Process() (*os.Process, error)
- func (d *Daemon) Signal(sig os.Signal) error
- func (d *Daemon) Status() (pid int, err error)
- func (d *Daemon) Stop() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Daemon ¶
Daemon is a structure that holds information about PID file.
func (*Daemon) Daemonize ¶
func (d *Daemon) Daemonize(workDir string, inFile io.Reader, outFile io.Writer, errFile io.Writer) error
Daemonize terminates the execution of the initial process and starts a new process in the background. If workDir is not zero length string, os.Chdir is executed with that value. New process will have standard input, output and error specified by inFile, outFile and errFile. PID file will be created with the second process ID.
func (*Daemon) Process ¶
Process returns an os.Process and error returned by os.FindProcess based on the content from PID file.
Click to show internal directories.
Click to hide internal directories.