1
0
mirror of https://github.com/rancher/os.git synced 2025-09-01 06:40:31 +00:00

Working out why linuxkit crashes in bootup by labeling init stages

Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
Sven Dowideit
2017-05-03 09:45:58 +10:00
parent 70ea28669a
commit aef937609e
5 changed files with 99 additions and 65 deletions

15
main.go
View File

@@ -1,6 +1,9 @@
package main
import (
"fmt"
"os"
"github.com/containernetworking/cni/plugins/ipam/host-local"
"github.com/containernetworking/cni/plugins/main/bridge"
"github.com/docker/docker/docker"
@@ -42,6 +45,18 @@ var entrypoints = map[string]func(){
}
func main() {
if 0 == 1 {
// TODO: move this into a "dev/debug +build"
fmt.Fprintf(os.Stderr, "ros main(%s) ppid:%d - print to stdio\n", os.Args[0], os.Getppid())
filename := "/dev/kmsg"
f, err := os.OpenFile(filename, os.O_WRONLY, 0644)
if err == nil {
fmt.Fprintf(f, "ros main(%s) ppid:%d - print to %s\n", os.Args[0], os.Getppid(), filename)
}
f.Close()
}
for name, f := range entrypoints {
reexec.Register(name, f)
}