mirror of
https://github.com/rancher/os.git
synced 2025-05-30 10:34:24 +00:00
24 lines
434 B
Go
24 lines
434 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, true); err != nil {
|
|
log.Error(err)
|
|
}
|
|
|
|
respawnBinPath, err := exec.LookPath("respawn")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
return syscall.Exec(respawnBinPath, []string{"respawn", "-f", "/etc/respawn.conf"}, os.Environ())
|
|
}
|