From 100cfe6a13064adee564c91d9782a7289390bfcf Mon Sep 17 00:00:00 2001 From: Christian Goll Date: Fri, 4 Feb 2022 11:06:27 +0100 Subject: [PATCH] finaly added /usr/bin/bash as default to cnt exec --- internal/app/wwctl/container/exec/main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/app/wwctl/container/exec/main.go b/internal/app/wwctl/container/exec/main.go index 69307473..cef337b3 100644 --- a/internal/app/wwctl/container/exec/main.go +++ b/internal/app/wwctl/container/exec/main.go @@ -18,9 +18,6 @@ func CobraRunE(cmd *cobra.Command, args []string) error { containerName := args[0] var allargs []string - if len(args) == 1 { - allargs = append(allargs, "/usr/bin/bash") - } if !container.ValidSource(containerName) { wwlog.Printf(wwlog.ERROR, "Unknown Warewulf container: %s\n", containerName) @@ -31,6 +28,9 @@ func CobraRunE(cmd *cobra.Command, args []string) error { allargs = append(allargs, "--bind", b) } allargs = append(allargs, args...) + if len(args) == 1 { + allargs = append(allargs, "/usr/bin/bash") + } c := exec.Command("/proc/self/exe", append([]string{"container", "exec", "__child"}, allargs...)...)