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

Process track: handle orphan process as well #10

Open
cappe987 opened this issue Jan 28, 2023 · 0 comments
Open

Process track: handle orphan process as well #10

cappe987 opened this issue Jan 28, 2023 · 0 comments

Comments

@cappe987
Copy link
Owner

Right now the process tracking stops when the main process exits. Any orphans will therefore not be monitored. Add flag (maybe -o|--orphans) that lets Capmon run until all child processes have exited.

Suggested implementation:
When waitpid indicates the process has exited, look in pid_tree for the next PID to wait for. Alternatively, keep a separate linked list of PIDs where you add everything that is added to pid_tree. When one PID indicates it has exited, remove it from the list and try the next. If the linked list is empty then all children have exited.

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

No branches or pull requests

1 participant