forkprocess

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package forkprocess starts a process which runs in the background. In Granted we use it to launch a browser when the user requests a web console. Previously, we used exec.Command from Go's stdlib for this, but is susceptible to being closed when the user pressed CTRL+C in their terminal.

Thanks to @patricksanders for the advice here. The github.com/ik5/fork_process package is also a good reference we'd like to acknowledge.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Process

type Process struct {
	UID     uint32
	GID     uint32
	Args    []string
	Workdir string
}

func New

func New(args ...string) (*Process, error)

New creates a new Process with the current user's user and group ID. Call Start() on the returned process to actually start it.

func (*Process) Start

func (p *Process) Start() error

Start launches a detached process under the current user and group ID.

Jump to

Keyboard shortcuts

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