diff --git a/initialize/config.go b/initialize/config.go index 68391c2..448632e 100644 --- a/initialize/config.go +++ b/initialize/config.go @@ -55,6 +55,12 @@ func Apply(cfg config.CloudConfig, ifaces []network.InterfaceGenerator, env *Env } } + for _, cmdline := range cfg.RunCMD { + prog := strings.Fields(cmdline)[0] + args := strings.Fields(cmdline)[1:] + exec.Command(prog, args...).Run() + } + lockf := path.Join(env.Workspace(), ".lock") if _, err = os.Stat(lockf); err == nil { @@ -72,12 +78,6 @@ func Apply(cfg config.CloudConfig, ifaces []network.InterfaceGenerator, env *Env log.Printf("Set hostname to %s", cfg.Hostname) } - for _, cmdline := range cfg.RunCMD { - prog := strings.Fields(cmdline)[0] - args := strings.Fields(cmdline)[1:] - exec.Command(prog, args...).Run() - } - for _, user := range cfg.Users { if user.Name == "" { log.Printf("User object has no 'name' field, skipping")