daemon

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const SubprocessTag = "sub"

SubprocessTag mark the current process is subprocess

Variables

This section is empty.

Functions

This section is empty.

Types

type Daemon

type Daemon struct {
	// contains filtered or unexported fields
}

Daemon support to running daemon process and create subprocess for working

func New added in v0.6.1

func New(l *logger.Logger) *Daemon

New create an instance of Daemon

func (*Daemon) KillPPid added in v0.6.1

func (d *Daemon) KillPPid()

KillPPid kill parent process

func (*Daemon) Run added in v0.6.1

func (d *Daemon) Run(args []string, recordPid bool, daemonDelay time.Duration, monitorDelay time.Duration, wd wait.Done)

Run running as a daemon process, and create a subprocess for working, the first argument must be an absolute path of the program name

func (*Daemon) Shutdown added in v0.6.1

func (d *Daemon) Shutdown() (err error)

Shutdown send a shutdown notify to the current daemon

Jump to

Keyboard shortcuts

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