Fix the way we run commands in chroot.
* Single quotes around chroot command cause it to fail. * The chroot command also gets passed through the CommandWrapper template, so having sudo would clash with however the user wants to run it. * Fix spelling mistake.
This commit is contained in:
parent
43e76cc7d0
commit
2af19060ce
|
@ -21,7 +21,7 @@ type Communicator struct {
|
|||
|
||||
func (c *Communicator) Start(cmd *packer.RemoteCmd) error {
|
||||
command, err := c.CmdWrapper(
|
||||
fmt.Sprintf("sudo chroot %s '%s'", c.Chroot, cmd.Command))
|
||||
fmt.Sprintf("chroot %s %s", c.Chroot, cmd.Command))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ func (c *Communicator) Start(cmd *packer.RemoteCmd) error {
|
|||
}
|
||||
|
||||
log.Printf(
|
||||
"Chroot executation exited with '%d': '%s'",
|
||||
"Chroot execution exited with '%d': '%s'",
|
||||
exitStatus, cmd.Command)
|
||||
cmd.SetExited(exitStatus)
|
||||
}()
|
||||
|
|
Loading…
Reference in New Issue