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"
|
2015-12-02 10:03:50 +00:00
|
|
|
"github.com/rancher/docker-from-scratch"
|
2016-08-04 22:47:12 +00:00
|
|
|
"github.com/rancher/os/cmd/cloudinitexecute"
|
|
|
|
"github.com/rancher/os/cmd/cloudinitsave"
|
2016-08-12 18:05:16 +00:00
|
|
|
"github.com/rancher/os/cmd/console"
|
2015-10-12 11:50:17 +00:00
|
|
|
"github.com/rancher/os/cmd/control"
|
2016-08-12 18:05:16 +00:00
|
|
|
"github.com/rancher/os/cmd/dockerinit"
|
2015-10-12 11:50:17 +00:00
|
|
|
"github.com/rancher/os/cmd/network"
|
|
|
|
"github.com/rancher/os/cmd/power"
|
|
|
|
"github.com/rancher/os/cmd/respawn"
|
2016-06-06 22:13:15 +00:00
|
|
|
"github.com/rancher/os/cmd/switchconsole"
|
2015-10-12 11:50:17 +00:00
|
|
|
"github.com/rancher/os/cmd/sysinit"
|
|
|
|
"github.com/rancher/os/cmd/systemdocker"
|
|
|
|
"github.com/rancher/os/cmd/userdocker"
|
|
|
|
"github.com/rancher/os/cmd/wait"
|
|
|
|
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,
|
2016-08-12 18:05:16 +00:00
|
|
|
"console": console.Main,
|
|
|
|
"console.sh": console.Main,
|
2016-08-04 22:47:12 +00:00
|
|
|
"docker": docker.Main,
|
2016-08-12 18:05:16 +00:00
|
|
|
"docker-init": dockerinit.Main,
|
2016-08-04 22:47:12 +00:00
|
|
|
"dockerlaunch": dockerlaunch.Main,
|
|
|
|
"halt": power.Halt,
|
|
|
|
"init": osInit.MainInit,
|
|
|
|
"netconf": network.Main,
|
|
|
|
"poweroff": power.PowerOff,
|
|
|
|
"reboot": power.Reboot,
|
|
|
|
"respawn": respawn.Main,
|
|
|
|
"ros-sysinit": sysinit.Main,
|
|
|
|
"shutdown": power.Main,
|
|
|
|
"switch-console": switchconsole.Main,
|
|
|
|
"system-docker": systemdocker.Main,
|
|
|
|
"user-docker": userdocker.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
|
|
|
}
|
|
|
|
}
|