Implement container signaling

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2015-02-06 22:33:10 -08:00
parent 0c1919c427
commit 9dcbc4f3f8
3 changed files with 15 additions and 1 deletions

View File

@@ -32,6 +32,8 @@ type parentProcess interface {
// startTime return's the process start time.
startTime() (string, error)
signal(os.Signal) error
}
type setnsProcess struct {
@@ -47,6 +49,10 @@ func (p *setnsProcess) startTime() (string, error) {
return system.GetProcessStartTime(p.pid())
}
func (p *setnsProcess) signal(s os.Signal) error {
return p.forkedProcess.Signal(s)
}
func (p *setnsProcess) start() (err error) {
defer p.parentPipe.Close()
if p.forkedProcess, err = p.execSetns(); err != nil {
@@ -260,3 +266,7 @@ func (p *initProcess) newUsernsSetupProcess() (parentProcess, error) {
config: p.config,
}, nil
}
func (p *initProcess) signal(s os.Signal) error {
return p.cmd.Process.Signal(s)
}