From 7a2fdf7a2dbbb93d851fe93cf55b98108094cf4f Mon Sep 17 00:00:00 2001 From: Lang Martin Date: Fri, 3 May 2019 14:42:57 -0400 Subject: [PATCH] executor and executor_linux debug launch prep and process start --- drivers/shared/executor/executor.go | 3 ++- drivers/shared/executor/executor_linux.go | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/shared/executor/executor.go b/drivers/shared/executor/executor.go index 40eb3c88f..a4abd864c 100644 --- a/drivers/shared/executor/executor.go +++ b/drivers/shared/executor/executor.go @@ -248,7 +248,7 @@ func (e *UniversalExecutor) Version() (*ExecutorVersion, error) { // Launch launches the main process and returns its state. It also // configures an applies isolation on certain platforms. func (e *UniversalExecutor) Launch(command *ExecCommand) (*ProcessState, error) { - e.logger.Debug("launching command", "command", command.Cmd, "args", strings.Join(command.Args, " ")) + e.logger.Debug("launch prep", "command", command.Cmd, "args", strings.Join(command.Args, " ")) e.commandCfg = command @@ -303,6 +303,7 @@ func (e *UniversalExecutor) Launch(command *ExecCommand) (*ProcessState, error) e.childCmd.Env = e.commandCfg.Env // Start the process + e.logger.Debug("launching", "command", command.Cmd, "args", strings.Join(command.Args, " ")) if err := e.childCmd.Start(); err != nil { return nil, fmt.Errorf("failed to start command path=%q --- args=%q: %v", path, e.childCmd.Args, err) } diff --git a/drivers/shared/executor/executor_linux.go b/drivers/shared/executor/executor_linux.go index a4fd87e48..91ec6ad98 100644 --- a/drivers/shared/executor/executor_linux.go +++ b/drivers/shared/executor/executor_linux.go @@ -97,7 +97,7 @@ func NewExecutorWithIsolation(logger hclog.Logger) Executor { // Launch creates a new container in libcontainer and starts a new process with it func (l *LibcontainerExecutor) Launch(command *ExecCommand) (*ProcessState, error) { - l.logger.Debug("launching command", "command", command.Cmd, "args", strings.Join(command.Args, " ")) + l.logger.Debug("launch prep", "command", command.Cmd, "args", strings.Join(command.Args, " ")) if command.Resources == nil { command.Resources = &drivers.Resources{ @@ -177,6 +177,8 @@ func (l *LibcontainerExecutor) Launch(command *ExecCommand) (*ProcessState, erro return nil, err } + l.logger.Debug("launching", "command", command.Cmd, "args", strings.Join(command.Args, " ")) + // the task process will be started by the container process := &libcontainer.Process{ Args: combined,