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

Added all signals, exit with child exit code, reap all remaining pid's #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bartmeuris
Copy link

This pull request contains the following changes:

  • added all signals mentioned in the docker/pkg/signal/signal_linux.go file (with the exception of SIGKILL and SIGSTOP), which should now be passed to the child process.
  • After the child process exits, I loop over the waitpid(-1, NULL, WNOHANG) to avoid child processes of your child process not being reaped.
  • return the child processes' exit code by returning WEXITSTATUS(cstatus);

@rciorba
Copy link
Owner

rciorba commented Apr 20, 2015

Thanks for sending this!
I added some comments inline.

Also, could you create a CONTRIBUTORS.txt and add your name to it?
Something along the lines of:
Author Name - Handling of return code and proper signal handling.

// the spawned child just terminated
debug_print("child_died:%d\n", pid);
return 0;
debug_print("child_pid exited: %d\n", status);
Copy link
Owner

Choose a reason for hiding this comment

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

The python tests make assertions based on these messages. If you want to update this message you should update the tests as well.

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.

2 participants