mirror of
https://github.com/rancher/os.git
synced 2025-06-27 23:36:49 +00:00
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.
29 lines
364 B
Go
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
|
|
}
|