1
0
mirror of https://github.com/rancher/os.git synced 2025-09-02 23:34:57 +00:00

Recovery console

This commit is contained in:
Josh Curl
2016-11-29 17:06:23 -08:00
committed by Sven Dowideit
parent 53225f6e9b
commit fecbb9df2e
8 changed files with 142 additions and 8 deletions

View File

@@ -0,0 +1,25 @@
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")
respawnBinPath, err := exec.LookPath("respawn")
if err != nil {
return err
}
return syscall.Exec(respawnBinPath, []string{"respawn", "-f", "/etc/respawn.conf"}, os.Environ())
}