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.
Index ¶
Constants ¶
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()
func (*MonitoredProc) Stop ¶
func (p *MonitoredProc) Stop() error
type ProcManager ¶
func (*ProcManager) Run ¶
func (p *ProcManager) Run(daemon string, args ...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(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.