INNER CODE UNIT · Go

main

kubernetes/kubeadm · kinder/images/base/docker/entrypoint/main.go:46

func main() {
	// prevent zombie processes since we will be PID1 for a while
	// https://linux.die.net/man/2/waitpid
	signal.Ignore(syscall.SIGCHLD)

	// grab the "real" entrypoint command and args from our args
	if len(os.Args) < 2 {
		log.Fatal("Not enough arguments to entrypoint!")
	}
	cmd, argv := os.Args[1], os.Args[1:]

	// wait for SIGUSR1 (or exit on SIGRTMIN+3 to match systemd)
	c := make(chan os.Signal, 1)
	signal.Notify(c, syscall.SIGUSR1, syscall.Signal(sigrtmin+3))
	log.Println("Waiting for SIGUSR1 ...")
	sig := <-c
	if sig != syscall.SIGUSR1 {
		log.Printf("Exiting after signal: %v != SIGUSR1", sig)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…