1
0
mirror of https://github.com/rancher/os.git synced 2025-08-31 06:11:12 +00:00
Files
os/main.go

51 lines
1.4 KiB
Go
Raw Normal View History

2015-02-08 21:38:37 -07:00
package main
import (
2016-06-28 15:13:45 -07:00
"github.com/containernetworking/cni/plugins/ipam/host-local"
"github.com/containernetworking/cni/plugins/main/bridge"
2016-05-31 21:38:10 -07:00
"github.com/docker/docker/docker"
2015-02-08 21:38:37 -07:00
"github.com/docker/docker/pkg/reexec"
2016-06-28 15:13:45 -07:00
"github.com/rancher/cniglue"
"github.com/rancher/os/cmd/cloudinitexecute"
"github.com/rancher/os/cmd/cloudinitsave"
"github.com/rancher/os/cmd/control"
"github.com/rancher/os/cmd/network"
"github.com/rancher/os/cmd/power"
"github.com/rancher/os/cmd/respawn"
"github.com/rancher/os/cmd/sysinit"
"github.com/rancher/os/cmd/systemdocker"
"github.com/rancher/os/cmd/wait"
"github.com/rancher/os/dfs"
osInit "github.com/rancher/os/init"
2015-02-08 21:38:37 -07:00
)
2016-05-31 21:38:10 -07:00
var entrypoints = map[string]func(){
"cloud-init-execute": cloudinitexecute.Main,
"cloud-init-save": cloudinitsave.Main,
"docker": docker.Main,
"dockerlaunch": dfs.Main,
"halt": power.Halt,
"init": osInit.MainInit,
"netconf": network.Main,
2016-11-28 00:06:00 -08:00
"poweroff": power.Off,
"reboot": power.Reboot,
"respawn": respawn.Main,
"ros-sysinit": sysinit.Main,
"shutdown": power.Main,
"system-docker": systemdocker.Main,
"wait-for-docker": wait.Main,
"cni-glue": glue.Main,
"bridge": bridge.Main,
"host-local": hostlocal.Main,
2015-02-17 14:31:20 -07:00
}
2015-02-08 21:38:37 -07:00
func main() {
2016-05-31 21:38:10 -07:00
for name, f := range entrypoints {
reexec.Register(name, f)
}
2015-02-17 17:31:19 -07:00
2015-02-08 21:38:37 -07:00
if !reexec.Init() {
2016-05-31 21:38:10 -07:00
control.Main()
2015-02-08 21:38:37 -07:00
}
}