Add setpgid for all called commands #1494
Merged
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.
Need to make sure signals are sent to all processes as sub-shells interfere with signal propagation. Using Setpgid to create a process group for the command and all it's subprocesses fixes this by allowing child to send the signals to the pgid, which thus gets sent to all processes in that group.
This is required for upcoming change to use sub-shells for all executed commands to eliminate need for shell parsing.
With this change it is always set to true and the pgid is always used to send signals to the process(es).
In the future it could be made configurable if needed.
Might be easier to review using the commits. The second commit is test cleanups and fixes where the first one contains the new code and tests.