1
0
mirror of https://github.com/rancher/os.git synced 2025-04-30 12:23:49 +00:00
os/main.go

30 lines
846 B
Go
Raw Normal View History

2015-02-09 04:38:37 +00:00
package main
import (
"os"
log "github.com/Sirupsen/logrus"
"github.com/docker/docker/pkg/reexec"
osInit "github.com/rancherio/os/init"
"github.com/rancherio/os/power"
2015-02-14 16:34:31 +00:00
"github.com/rancherio/os/respawn"
2015-02-09 04:38:37 +00:00
"github.com/rancherio/os/sysinit"
"github.com/rancherio/os/user"
)
func main() {
reexec.Register("init", osInit.MainInit)
reexec.Register("/init", osInit.MainInit)
reexec.Register("./init", osInit.MainInit)
reexec.Register("/sbin/init-sys", sysinit.SysInit)
reexec.Register("/usr/bin/system-docker", user.SystemDocker)
reexec.Register("system-docker", user.SystemDocker)
reexec.Register("poweroff", power.PowerOff)
reexec.Register("reboot", power.Reboot)
reexec.Register("halt", power.Halt)
2015-02-14 16:34:31 +00:00
reexec.Register("respawn", respawn.Main)
2015-02-09 04:38:37 +00:00
if !reexec.Init() {
log.Fatalf("Failed to find an entry point for %s", os.Args[0])
}
}