New oom sync (#257)
* Vendor in runc afaa21f79ade3b2e99a68f3f15e7219155aa4662 This updates the Dockerfile to use go 1.6.2 and install pkg-config are both are now needed by runc. Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com> * Add support for runc create/start operation Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com> * Remove dependency on runc state directory for OOM handler Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com> * Add OOM test Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
parent
cf554d59dd
commit
8040df4e89
214 changed files with 215 additions and 30135 deletions
|
@ -3,6 +3,7 @@ package main
|
|||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/signal"
|
||||
"path/filepath"
|
||||
|
@ -77,7 +78,7 @@ func start(log *os.File) error {
|
|||
writeMessage(log, "warn", err)
|
||||
}
|
||||
}()
|
||||
if err := p.start(); err != nil {
|
||||
if err := p.create(); err != nil {
|
||||
p.delete()
|
||||
return err
|
||||
}
|
||||
|
@ -102,6 +103,11 @@ func start(log *os.File) error {
|
|||
Height: uint16(h),
|
||||
}
|
||||
term.SetWinsize(p.console.Fd(), &ws)
|
||||
case 2:
|
||||
// tell runtime to execute the init process
|
||||
if err := p.start(); err != nil {
|
||||
syscall.Kill(p.pid(), syscall.SIGKILL)
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
@ -120,6 +126,7 @@ func start(log *os.File) error {
|
|||
}
|
||||
// runtime has exited so the shim can also exit
|
||||
if exitShim {
|
||||
ioutil.WriteFile(fmt.Sprintf("/tmp/shim-delete-%d", p.pid()), []byte("deleting"), 0600)
|
||||
p.delete()
|
||||
p.Wait()
|
||||
return nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue