Documentation
¶
Overview ¶
Package background contains an abstraction for running processes in the background.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrUserKilled = xerrors.Errorf("daemon killed by user")
Functions ¶
This section is empty.
Types ¶
type Process ¶
type Process struct {
// contains filtered or unexported fields
}
Process is an abstraction for running a command as a background process.
func New ¶
New returns an instantiated daemon. binName is the expected /proc/<pid>/cmdline value used for exit detection; pass cmd for plain invocations, or the post-exec binary name for exec wrappers (e.g. "dockerd" when cmd is "unshare ... -- sh -c 'exec dockerd ...'").
func (*Process) Restart ¶
Restart kill the running process and reruns the command with the updated binName, cmd and args. See New for the meaning of binName.
func (*Process) Run ¶
Run runs the command and waits for it to exit. It is a convenience function that combines both Start() and Wait().