luci: Index | Files

package exec2

import ""

Package exec2 is like os/exec but supports timeout in Wait and process containment for unix using process group.


Package Files

doc.go exec2.go exec2_unix.go

type Cmd Uses

type Cmd struct {
    // contains filtered or unexported fields

Cmd is like exec.Cmd, but supports terminate and process containment.

func CommandContext Uses

func CommandContext(ctx context.Context, name string, arg ...string) *Cmd

CommandContext is like exec.CommandContext, but it uses process group by default and supports timeout in Wait function.

func (*Cmd) Kill Uses

func (c *Cmd) Kill() error

Kill kills process.

func (*Cmd) Start Uses

func (c *Cmd) Start() error

Start starts command with appropriate setup.

func (*Cmd) Terminate Uses

func (c *Cmd) Terminate() error

Terminate sends SIGTERM on unix or CTRL+BREAK on windows.

func (*Cmd) Wait Uses

func (c *Cmd) Wait() error

Wait waits to process to finish.

Package exec2 imports 4 packages (graph) and is imported by 2 packages. Updated 2021-01-18. Refresh now. Tools for package owners.