mirror of
https://github.com/rancher/os.git
synced 2025-09-01 14:48:55 +00:00
Move sysinit to cmd
This commit is contained in:
@@ -14,7 +14,7 @@ import (
|
|||||||
"github.com/rancherio/os/util"
|
"github.com/rancherio/os/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
func SysInit() {
|
func Main() {
|
||||||
if err := sysInit(); err != nil {
|
if err := sysInit(); err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
4
main.go
4
main.go
@@ -9,10 +9,10 @@ import (
|
|||||||
"github.com/rancherio/os/cmd/control"
|
"github.com/rancherio/os/cmd/control"
|
||||||
"github.com/rancherio/os/cmd/power"
|
"github.com/rancherio/os/cmd/power"
|
||||||
"github.com/rancherio/os/cmd/respawn"
|
"github.com/rancherio/os/cmd/respawn"
|
||||||
|
"github.com/rancherio/os/cmd/sysinit"
|
||||||
"github.com/rancherio/os/cmd/systemdocker"
|
"github.com/rancherio/os/cmd/systemdocker"
|
||||||
"github.com/rancherio/os/cmd/tlsconf"
|
"github.com/rancherio/os/cmd/tlsconf"
|
||||||
osInit "github.com/rancherio/os/init"
|
osInit "github.com/rancherio/os/init"
|
||||||
"github.com/rancherio/os/sysinit"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func registerCmd(cmd string, mainFunc func()) {
|
func registerCmd(cmd string, mainFunc func()) {
|
||||||
@@ -35,7 +35,7 @@ func registerCmd(cmd string, mainFunc func()) {
|
|||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
registerCmd("/init", osInit.MainInit)
|
registerCmd("/init", osInit.MainInit)
|
||||||
registerCmd(osInit.SYSINIT, sysinit.SysInit)
|
registerCmd(osInit.SYSINIT, sysinit.Main)
|
||||||
registerCmd("/usr/bin/system-docker", systemdocker.Main)
|
registerCmd("/usr/bin/system-docker", systemdocker.Main)
|
||||||
registerCmd("/sbin/poweroff", power.PowerOff)
|
registerCmd("/sbin/poweroff", power.PowerOff)
|
||||||
registerCmd("/sbin/reboot", power.Reboot)
|
registerCmd("/sbin/reboot", power.Reboot)
|
||||||
|
Reference in New Issue
Block a user