Use exec instead of popen to run ign-launch binary #151
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🦟 Bug fix
Fixes #149
Summary
Currently, the ruby processes creates a new process to run the
ign-launch
binary. For some reason, signals sent to the ruby processes don't propagate to the child process. In addition to the issue described in #149, sending aSIGINT
signal (or evenSIGKILL
) directly viakill
to the parent process doesn't terminate the launched process.For example, launch the following:
sleep.ign
Launch with:
ign launch sleep.ign
The process list shows there are two processes associated with the launch
Killing the top/parent process does not terminate the child
https://www.vidarholen.net/contents/blog/?p=34 explains the problem (which I learned about from ros2/launch#484).
The solution I propose is to replace the ruby process with the
ign-launch
process usingexec
. Here's the process list with the new approach.Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.