Skip to content

Commit

Permalink
stream to task log
Browse files Browse the repository at this point in the history
  • Loading branch information
tedim52 committed Jul 1, 2024
1 parent de39b7a commit 4218398
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ func (builtin *RunShCapabilities) Execute(ctx context.Context, _ *builtin_argume
//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{"touch /tmp/task.log &&", shellWrapperCommand, "-c", fmt.Sprintf("\"%v\" %v %v %v", commandToRun, ">> /tmp/task.log", " && ", "tail -F /tmp/task.log")}
fullCommandToRun := []string{shellWrapperCommand, "-c", fmt.Sprintf("\"%v\" %v %v", commandToRun, ">>", taskLogFilePath)}
// create the log file
// tail the log file

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,11 @@ const (

// enables init mode on containers; cleaning up any zombie processes
tiniEnabled = true

taskLogFilePath = "/tmp/task.log"
)

var runTailCommandToPreventContainerToStopOnCreating = []string{"tail", "-f", "/dev/null"}
var runTailCommandToPreventContainerToStopOnCreating = []string{shellWrapperCommand, "-c", fmt.Sprintf("touch %v && tail -F %v", taskLogFilePath, taskLogFilePath)}

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 4218398

Please sign in to comment.