Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion Framework/Core/src/runDataProcessing.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1734,6 +1734,19 @@ bool isOutputToPipe()
return ((s.st_mode & S_IFIFO) != 0);
}

bool isInputConfig()
{
struct stat s;
int r = fstat(STDIN_FILENO, &s);
// If stdin cannot be statted, we assume the shell is some sort of
// non-interactive container thing
if (r < 0) {
return false;
}
// If stdin is a pipe or a file, we try to fetch configuration from there
return ((s.st_mode & S_IFIFO) != 0 || (s.st_mode & S_IFREG) != 0);
}

void overrideCloning(ConfigContext& ctx, WorkflowSpec& workflow)
{
struct CloningSpec {
Expand Down Expand Up @@ -2085,7 +2098,8 @@ int doMain(int argc, char** argv, o2::framework::WorkflowSpec const& workflow,

std::vector<DataProcessorInfo> dataProcessorInfos;
CommandInfo commandInfo{};
if (isatty(STDIN_FILENO) == false) {

if (isatty(STDIN_FILENO) == false && isInputConfig()) {
std::vector<DataProcessorSpec> importedWorkflow;
WorkflowSerializationHelpers::import(std::cin, importedWorkflow, dataProcessorInfos, commandInfo);

Expand Down