1
0
mirror of https://github.com/rancher/os.git synced 2025-06-05 13:12:26 +00:00
os/cmd/control/recovery_init.go

25 lines
434 B
Go
Raw Normal View History

2016-11-30 01:06:23 +00:00
package control
import (
"os"
"os/exec"
"syscall"
2018-09-16 04:55:26 +00:00
"github.com/rancher/os/pkg/log"
"github.com/codegangsta/cli"
2016-11-30 01:06:23 +00:00
)
func recoveryInitAction(c *cli.Context) error {
if err := writeRespawn("root", false, true); err != nil {
2016-11-30 01:06:23 +00: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())
}