Skip to content

Commit

Permalink
fix full command
Browse files Browse the repository at this point in the history
  • Loading branch information
tedim52 committed Jul 1, 2024
1 parent 4218398 commit d81f83b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d81f83b

Please sign in to comment.