diff --git a/src/CraneCtld/CranedKeeper.cpp b/src/CraneCtld/CranedKeeper.cpp index 6f80d86b..73bc6bca 100644 --- a/src/CraneCtld/CranedKeeper.cpp +++ b/src/CraneCtld/CranedKeeper.cpp @@ -266,6 +266,7 @@ crane::grpc::ExecuteTasksRequest CranedStub::NewExecuteTasksRequest( mutable_task->set_cwd(task->cwd); mutable_task->set_get_user_env(task->get_user_env); + mutable_task->set_container(task->container); for (const auto &hostname : task->CranedIds()) @@ -279,6 +280,7 @@ crane::grpc::ExecuteTasksRequest CranedStub::NewExecuteTasksRequest( if (task->type == crane::grpc::Batch) { auto &meta_in_ctld = std::get(task->meta); auto *mutable_meta = mutable_task->mutable_batch_meta(); + mutable_meta->set_interpreter(meta_in_ctld.interpreter); mutable_meta->set_output_file_pattern(meta_in_ctld.output_file_pattern); mutable_meta->set_error_file_pattern(meta_in_ctld.error_file_pattern); mutable_meta->set_sh_script(meta_in_ctld.sh_script); diff --git a/src/Craned/TaskExecutor.cpp b/src/Craned/TaskExecutor.cpp index 13052af6..bff2bfb1 100644 --- a/src/Craned/TaskExecutor.cpp +++ b/src/Craned/TaskExecutor.cpp @@ -324,10 +324,11 @@ CraneErr ProcessInstance::Spawn(util::Cgroup* cgroup) { } // e.g., /bin/bash -c "/bin/zsh script.sh --arg1 --arg2 ..." + auto cmd = fmt::format("{} {} {}", m_batch_meta_.interpreter, + m_executive_path_, arguments); + argv.emplace_back("-c"); - argv.emplace_back(fmt::format("\"{} {} {}\"", m_batch_meta_.interpreter, - m_executive_path_, arguments) - .c_str()); + argv.emplace_back(cmd.c_str()); argv.emplace_back(nullptr); execv(argv[0], const_cast(argv.data()));