Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjustments to launch script to handle SIGINT properly #2143

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -178,26 +178,21 @@ public void doGenerate(List<FederateInstance> federates, RtiConfig rtiConfig) {
.append("\n");
}
}
if (host.equals("localhost") || host.equals("0.0.0.0")) {
// Local PID managements
shCode.append(
"echo \"#### Bringing the RTI back to foreground so it can receive Control-C.\"" + "\n");
shCode.append("fg %1" + "\n");
}
// Wait for launched processes to finish
shCode
.append(
String.join(
"\n",
"echo \"RTI has exited. Wait for federates to exit.\"",
"# Wait for launched processes to finish.",
"# The errors are handled separately via trap.",
"EXITED_SUCCESSFULLY=true",
"wait $RTI || EXITED_SUCCESSFULLY=false",
"for pid in \"${pids[@]}\"",
"do",
" wait $pid || exit $?",
" wait $pid",
" if [ $? -ne 0 -a $? -ne 127 ]; then",
" EXITED_SUCCESSFULLY=false",
" fi",
"done",
"echo \"All done.\"",
"EXITED_SUCCESSFULLY=true"))
"echo \"All done.\""))
.append("\n");

// Create bin directory for the script.
Expand Down
Loading