From 15c18c83a9df066d3ced103ba06e8492539811ce Mon Sep 17 00:00:00 2001 From: Chris Lundquist Date: Mon, 16 May 2016 05:59:39 +0000 Subject: [PATCH] [lxc] default to target runlevel 3 --- builder/lxc/config.go | 4 ++++ builder/lxc/step_wait_init.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/builder/lxc/config.go b/builder/lxc/config.go index 2e05b00f5..4c4152592 100644 --- a/builder/lxc/config.go +++ b/builder/lxc/config.go @@ -50,6 +50,10 @@ func NewConfig(raws ...interface{}) (*Config, error) { c.ContainerName = fmt.Sprintf("packer-%s", c.PackerBuildName) } + if c.TargetRunlevel == 0 { + c.TargetRunlevel = 3 + } + if c.CommandWrapper == "" { c.CommandWrapper = "{{.Command}}" } diff --git a/builder/lxc/step_wait_init.go b/builder/lxc/step_wait_init.go index 5b7d8c5cb..4b5d28fb2 100644 --- a/builder/lxc/step_wait_init.go +++ b/builder/lxc/step_wait_init.go @@ -93,7 +93,7 @@ func (s *StepWaitInit) waitForInit(state multistep.StateBag, cancel <-chan struc log.Printf("Container finished init.") break } else if currentRunlevel > targetRunlevel { - log.Printf("Expected Runlevel %d, Got Runlevel %s, continuing", targetRunlevel, currentRunlevel) + log.Printf("Expected Runlevel %s, Got Runlevel %s, continuing", targetRunlevel, currentRunlevel) break }