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:
23
cmd/waitfornetwork/waitfornetwork.go
Normal file
23
cmd/waitfornetwork/waitfornetwork.go
Normal 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 {}
|
||||
}
|
Reference in New Issue
Block a user