mirror of
https://github.com/rancher/os.git
synced 2025-06-20 04:01:55 +00:00
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au> WIP - dont merge Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
27 lines
512 B
Go
27 lines
512 B
Go
package control
|
|
|
|
import (
|
|
"os"
|
|
"os/exec"
|
|
"syscall"
|
|
|
|
log "github.com/Sirupsen/logrus"
|
|
"github.com/codegangsta/cli"
|
|
)
|
|
|
|
func recoveryInitAction(c *cli.Context) error {
|
|
if err := writeRespawn("root", false); err != nil {
|
|
log.Error(err)
|
|
}
|
|
|
|
os.Setenv("TERM", "linux")
|
|
os.Setenv("PS1", `[Recovery Console: \l \u@\h \W]\$`)
|
|
|
|
respawnBinPath, err := exec.LookPath("respawn")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
return syscall.Exec(respawnBinPath, []string{"respawn", "-f", "/etc/respawn.conf"}, os.Environ())
|
|
}
|