2015-02-09 04:38:37 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2016-06-28 22:13:45 +00:00
|
|
|
"github.com/containernetworking/cni/plugins/ipam/host-local"
|
|
|
|
"github.com/containernetworking/cni/plugins/main/bridge"
|
2016-06-01 04:38:10 +00:00
|
|
|
"github.com/docker/docker/docker"
|
2015-02-09 04:38:37 +00:00
|
|
|
"github.com/docker/docker/pkg/reexec"
|
2016-06-28 22:13:45 +00:00
|
|
|
"github.com/rancher/cniglue"
|
2016-08-04 22:47:12 +00:00
|
|
|
"github.com/rancher/os/cmd/cloudinitexecute"
|
|
|
|
"github.com/rancher/os/cmd/cloudinitsave"
|
2015-10-12 11:50:17 +00:00
|
|
|
"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"
|
2016-10-19 23:21:35 +00:00
|
|
|
"github.com/rancher/os/dfs"
|
2015-10-12 11:50:17 +00:00
|
|
|
osInit "github.com/rancher/os/init"
|
2015-02-09 04:38:37 +00:00
|
|
|
)
|
|
|
|
|
2016-06-01 04:38:10 +00:00
|
|
|
var entrypoints = map[string]func(){
|
2016-08-04 22:47:12 +00:00
|
|
|
"cloud-init-execute": cloudinitexecute.Main,
|
|
|
|
"cloud-init-save": cloudinitsave.Main,
|
|
|
|
"docker": docker.Main,
|
2016-10-19 23:21:35 +00:00
|
|
|
"dockerlaunch": dfs.Main,
|
2016-08-04 22:47:12 +00:00
|
|
|
"halt": power.Halt,
|
|
|
|
"init": osInit.MainInit,
|
|
|
|
"netconf": network.Main,
|
2016-11-28 08:06:00 +00:00
|
|
|
"poweroff": power.Off,
|
2016-08-04 22:47:12 +00:00
|
|
|
"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 21:31:20 +00:00
|
|
|
}
|
|
|
|
|
2015-02-09 04:38:37 +00:00
|
|
|
func main() {
|
2016-06-01 04:38:10 +00:00
|
|
|
for name, f := range entrypoints {
|
|
|
|
reexec.Register(name, f)
|
|
|
|
}
|
2015-02-18 00:31:19 +00:00
|
|
|
|
2015-02-09 04:38:37 +00:00
|
|
|
if !reexec.Init() {
|
2016-06-01 04:38:10 +00:00
|
|
|
control.Main()
|
2015-02-09 04:38:37 +00:00
|
|
|
}
|
|
|
|
}
|