1
0
mirror of https://github.com/rancher/os.git synced 2025-06-27 23:36:49 +00:00
os/init/one.go
Darren Shepherd cd2829d220 Farewell PID one
This change no longer runs Docker as PID 1.  Instead PID 1 is a very
simple zombie reaper and Docker is moved as a child of that PID.
2015-12-22 15:38:32 -07:00

29 lines
364 B
Go

// +build linux
package init
import (
"os"
"os/signal"
"syscall"
)
func pidOne() error {
c := make(chan os.Signal)
signal.Notify(c, syscall.SIGCHLD)
var (
ws syscall.WaitStatus
rus syscall.Rusage
)
for range c {
for {
if pid, err := syscall.Wait4(-1, &ws, syscall.WNOHANG, &rus); err != nil || pid <= 0 {
break
}
}
}
return nil
}