proc

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2016 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Copyright 2016 The Rook Authors. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 The Rook Authors. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 The Rook Authors. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	StartAction = "start"
	RunAction   = "run"
	StopAction  = "stop"

	RestartExisting ProcStartPolicy = iota
	ReuseExisting
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MonitoredProc

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

func (*MonitoredProc) Monitor

func (p *MonitoredProc) Monitor(logName string)

func (*MonitoredProc) Stop

func (p *MonitoredProc) Stop() error

type ProcManager

type ProcManager struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func New

func New(executor exec.Executor) *ProcManager

Create a new proc manager

func (*ProcManager) Run

func (p *ProcManager) Run(logName, tool string, args ...string) error

Start a child process and wait for its completion

func (*ProcManager) RunWithOutput added in v0.1.1

func (p *ProcManager) RunWithOutput(logName, tool string, args ...string) (string, error)

Start a child process and wait for its completion

func (*ProcManager) Shutdown

func (p *ProcManager) Shutdown()

func (*ProcManager) Start

func (p *ProcManager) Start(logName, daemon, procSearchPattern string, policy ProcStartPolicy, args ...string) (*MonitoredProc, error)

Start the given daemon and provided arguments. Handling of any matching existing process will be in accordance with the given ProcStartPolicy. The search pattern will be used to search through the cmdline args of existing processes to find any matching existing process. Therefore, it should be a regex pattern that can uniquely identify the process (e.g., --id=1)

type ProcStartPolicy

type ProcStartPolicy int

type UnixProcess

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

UnixProcess is an implementation of Process that contains Unix-specific fields and information.

func (*UnixProcess) Executable

func (p *UnixProcess) Executable() string

func (*UnixProcess) PPid

func (p *UnixProcess) PPid() int

func (*UnixProcess) Pid

func (p *UnixProcess) Pid() int

func (*UnixProcess) Refresh

func (p *UnixProcess) Refresh() error

Refresh reloads all the data associated with this process.

Jump to

Keyboard shortcuts

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