1
0
mirror of https://github.com/rancher/os.git synced 2025-08-31 06:11:12 +00:00
Files
os/cmd/control/recovery_init.go

25 lines
435 B
Go
Raw Normal View History

2016-11-29 17:06:23 -08:00
package control
import (
"os"
"os/exec"
"syscall"
"github.com/burmilla/os/pkg/log"
"github.com/codegangsta/cli"
2016-11-29 17:06:23 -08:00
)
func recoveryInitAction(c *cli.Context) error {
if err := writeRespawn("root", false, true); err != nil {
2016-11-29 17:06:23 -08:00
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())
}