forked from rancher/os
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
59 lines (55 loc) · 1.8 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package main
import (
"github.com/containernetworking/cni/plugins/ipam/host-local"
"github.com/containernetworking/cni/plugins/main/bridge"
"github.com/docker/docker/docker"
"github.com/docker/docker/pkg/reexec"
"github.com/rancher/cniglue"
"github.com/rancher/docker-from-scratch"
"github.com/rancher/os/cmd/cloudinitexecute"
"github.com/rancher/os/cmd/cloudinitsave"
"github.com/rancher/os/cmd/console"
"github.com/rancher/os/cmd/control"
"github.com/rancher/os/cmd/dockerinit"
"github.com/rancher/os/cmd/network"
"github.com/rancher/os/cmd/power"
"github.com/rancher/os/cmd/respawn"
"github.com/rancher/os/cmd/switchconsole"
"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"
)
var entrypoints = map[string]func(){
"cloud-init-execute": cloudinitexecute.Main,
"cloud-init-save": cloudinitsave.Main,
"console": console.Main,
"console.sh": console.Main,
"docker": docker.Main,
"docker-init": dockerinit.Main,
"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,
}
func main() {
for name, f := range entrypoints {
reexec.Register(name, f)
}
if !reexec.Init() {
control.Main()
}
}