1
0
mirror of https://github.com/rancher/os.git synced 2025-08-31 14:23:11 +00:00

add power functions - down, restart, halt

This commit is contained in:
sidharthamani
2015-02-12 15:22:48 -08:00
parent 70b376ce6a
commit 56a4f96b24
4 changed files with 167 additions and 7 deletions

View File

@@ -6,6 +6,7 @@ import (
log "github.com/Sirupsen/logrus"
"github.com/docker/docker/pkg/reexec"
osInit "github.com/rancherio/os/init"
"github.com/rancherio/os/power"
"github.com/rancherio/os/respawn"
"github.com/rancherio/os/sysinit"
"github.com/rancherio/os/user"
@@ -18,8 +19,10 @@ func main() {
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)
reexec.Register("respawn", respawn.Main)
if !reexec.Init() {
log.Fatalf("Failed to find an entry point for %s", os.Args[0])
}