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

Job control improvements #175

Closed
wants to merge 5 commits into from

Conversation

caseman
Copy link

@caseman caseman commented Nov 14, 2020

Draft fix for #174

  • Fixes SIGSTOP/SIGCONT signal handling
  • removes intermediate fork in run_command_list_array for background jobs so that actual child state can be tracked properly
  • improves reliability of job status updates and notifications

I included a jobs.sh test script, but it isn't incorporated into the test target because it causes it hang. Running it separately it works fine though and exits cleanly. Also not sure if these tests are only for parity, if so then it needs more attention since I didn't attempt to run it in other shells yet.

See also XXX comments inline. In particular the one about the general fork abstraction. I feel like forking a job process could be generalized since it happens in several places.

@@ -226,7 +226,11 @@ static bool _job_wait(struct mrsh_state *state, pid_t pid, int options) {
// shell. Child processes want to block until their own children have
// terminated.
if (!priv->child) {
#ifdef WCONTINUED
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this the Archlinux build fails which is interesting since this was introduced in Linux afaik. It could be because of the build options though if they are excluding this somehow by specifying an older standard.

@caseman
Copy link
Author

caseman commented Nov 18, 2020

Superceded by: #176

@caseman caseman closed this Nov 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant