diff --git a/core/server/api_container/server/startosis_engine/kurtosis_instruction/tasks/run_sh.go b/core/server/api_container/server/startosis_engine/kurtosis_instruction/tasks/run_sh.go index 316cea9aa9..007fea03c2 100644 --- a/core/server/api_container/server/startosis_engine/kurtosis_instruction/tasks/run_sh.go +++ b/core/server/api_container/server/startosis_engine/kurtosis_instruction/tasks/run_sh.go @@ -276,12 +276,7 @@ func (builtin *RunShCapabilities) Execute(ctx context.Context, _ *builtin_argume if err != nil { return "", stacktrace.Propagate(err, "error occurred while preparing the sh command to execute on the image") } - //fullCommandToRun := []string{shellWrapperCommand, "-c", fmt.Sprintf("%v \"$(%v)\" %v %v", "printf \"%s\\n\"", commandToRun, ">>", "/proc/1/fd/1")} - //fullCommandToRun := []string{shellWrapperCommand, "-c", fmt.Sprintf("%v | while IFS= read -r line; do %v \"$line\"; done %v %v", commandToRun, "printf \"%s\\n\"", ">>", "/proc/1/fd/1")} - // create the log file - fullCommandToRun := []string{shellWrapperCommand, "-c", fmt.Sprintf("\"%v\" %v %v", commandToRun, ">>", taskLogFilePath)} - // create the log file - // tail the log file + fullCommandToRun := []string{shellWrapperCommand, "-c", fmt.Sprintf("{ %v; } %v %v %v", commandToRun, ">>", "/tmp/task.log", "2>&1")} // run the command passed in by user in the container createDefaultDirectoryResult, err := executeWithWait(ctx, builtin.serviceNetwork, builtin.name, builtin.wait, fullCommandToRun) diff --git a/core/server/api_container/server/startosis_engine/kurtosis_instruction/tasks/tasks_shared.go b/core/server/api_container/server/startosis_engine/kurtosis_instruction/tasks/tasks_shared.go index d056ab78ae..23f100eceb 100644 --- a/core/server/api_container/server/startosis_engine/kurtosis_instruction/tasks/tasks_shared.go +++ b/core/server/api_container/server/startosis_engine/kurtosis_instruction/tasks/tasks_shared.go @@ -55,11 +55,9 @@ const ( // enables init mode on containers; cleaning up any zombie processes tiniEnabled = true - - taskLogFilePath = "/tmp/task.log" ) -var runTailCommandToPreventContainerToStopOnCreating = []string{shellWrapperCommand, "-c", fmt.Sprintf("touch %v && tail -F %v", taskLogFilePath, taskLogFilePath)} +var runTailCommandToPreventContainerToStopOnCreating = []string{shellWrapperCommand, "-c", "touch /tmp/task.log && tail -F /tmp/task.log"} func parseStoreFilesArg(serviceNetwork service_network.ServiceNetwork, arguments *builtin_argument.ArgumentValuesSet) ([]*store_spec.StoreSpec, *startosis_errors.InterpretationError) { var result []*store_spec.StoreSpec