Merge pull request #526 from hqhq/hq_remove_procStart

Remove procStart
This commit is contained in:
Alexander Morozov
2016-02-16 09:12:04 -08:00
3 changed files with 10 additions and 17 deletions
+10 -14
View File
@@ -232,23 +232,19 @@ func (l *LinuxFactory) StartInitialization() (err error) {
os.Clearenv()
var i initer
defer func() {
// if we have an error during the initialization of the container's init then send it back to the
// parent process in the form of an initError.
if err != nil {
if _, ok := i.(*linuxStandardInit); ok {
// Synchronisation only necessary for standard init.
if err := utils.WriteJSON(pipe, syncT{procError}); err != nil {
panic(err)
}
}
if err := utils.WriteJSON(pipe, newSystemError(err)); err != nil {
panic(err)
}
} else {
if err := utils.WriteJSON(pipe, syncT{procStart}); err != nil {
// We have an error during the initialization of the container's init,
// send it back to the parent process in the form of an initError.
// If container's init successed, syscall.Exec will not return, hence
// this defer function will never be called.
if _, ok := i.(*linuxStandardInit); ok {
// Synchronisation only necessary for standard init.
if err := utils.WriteJSON(pipe, syncT{procError}); err != nil {
panic(err)
}
}
if err := utils.WriteJSON(pipe, newSystemError(err)); err != nil {
panic(err)
}
// ensure that this pipe is always closed
pipe.Close()
}()
-1
View File
@@ -14,7 +14,6 @@ type syncType uint8
const (
procReady syncType = iota
procError
procStart
procRun
)
-2
View File
@@ -247,8 +247,6 @@ loop:
return newSystemError(err)
}
switch procSync.Type {
case procStart:
break loop
case procReady:
if err := p.manager.Set(p.config.Config); err != nil {
return newSystemError(err)