diff --git a/builder/lxd/communicator.go b/builder/lxd/communicator.go index a19f9d33a..16f4d35eb 100644 --- a/builder/lxd/communicator.go +++ b/builder/lxd/communicator.go @@ -4,12 +4,10 @@ import ( "fmt" "github.com/mitchellh/packer/packer" "io" - "io/ioutil" "log" "os" "os/exec" "path/filepath" - "strings" "syscall" ) @@ -140,31 +138,3 @@ func (c *Communicator) Execute(commandString string) (*exec.Cmd, error) { return localCmd, nil } - -func (c *Communicator) CheckInit() (string, error) { - log.Printf("Debug runlevel exec") - localCmd, err := c.Execute("/sbin/runlevel") - - if err != nil { - return "", err - } - - pr, _ := localCmd.StdoutPipe() - if err = localCmd.Start(); err != nil { - return "", err - } - - output, err := ioutil.ReadAll(pr) - - if err != nil { - return "", err - } - - err = localCmd.Wait() - - if err != nil { - return "", err - } - - return strings.TrimSpace(string(output)), nil -}