1
0
mirror of https://github.com/rancher/os.git synced 2025-09-01 14:48:55 +00:00

Leave dhcpcd (and netconf) running in the background.

Add wait-for-network.
This commit is contained in:
Ivan Mikushin
2015-11-06 21:53:00 +05:00
parent 4d798edd1b
commit 56b1aa67ac
4 changed files with 61 additions and 5 deletions

View File

@@ -0,0 +1,23 @@
package waitfornetwork
import (
"github.com/rancher/os/cmd/network"
"os"
"os/signal"
"syscall"
)
func handleTerm() {
c := make(chan os.Signal, 1)
signal.Notify(c, syscall.SIGTERM)
<-c
os.Exit(0)
}
func Main() {
go handleTerm()
if _, err := os.Stat(network.NETWORK_DONE); err == nil {
os.Exit(0)
}
select {}
}