From 6cad908751d8e3473bb6981b0dca9f1c6f9bac82 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Mon, 9 Nov 2015 18:29:30 +0000 Subject: [PATCH] always run commands in runcmd Signed-off-by: Vasiliy Tolstov --- initialize/config.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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")