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

stdin-killer: do not setpgrp if already leader #1881

Merged
merged 1 commit into from
Aug 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion teuthology/task/install/bin/stdin-killer
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,10 @@ if __name__ == "__main__":
}

if NS.setpgrp == "self":
os.setpgrp()
pgrp = os.getpgrp()
if pgrp != os.getpid():
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks correct as EPERM errno is returned if the process calling setpgrp is the session/process group leader. Question is, what caused this failure now.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure but clearly under normal circumstances stdin-killer is not already the process group leader. Perhaps when it was wrapped with the ulimit wrapper.

os.setpgrp()
pgrp = os.getpgrp()
elif NS.setpgrp == "child":
popen_kwargs["preexec_fn"] = os.setpgrp
pgrp = None
Expand Down