Skip to content

Commit

Permalink
Update pause.c following upstream changes
Browse files Browse the repository at this point in the history
Here is a link to minor modifications to the source:
kubernetes/kubernetes#43578

Signed-off-by: Vinothkumar Siddharth <[email protected]>
  • Loading branch information
vsiddharth committed May 18, 2017
1 parent 2ec66f7 commit a0d6369
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions misc/pause-container/buildPause/pause.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
This file is derived from the Kubernetes Project, Copyright 2016 The Kubernetes Authors.
The original code may be found at:
https://github.com/kubernetes/kubernetes/blob/c25c186ec544cf3501a31e77e8fbabce7b138b49/build/pause/pause.c
https://github.com/kubernetes/kubernetes/blob/17b22cb01c647d50ed186c8a94f9c7aa2d9bcd2e/build/pause/pause.c
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -29,14 +29,13 @@ static void sigdown(int signo) {
}

static void sigreap(int signo) {
while (waitpid(-1, NULL, WNOHANG) > 0)
;
while (waitpid(-1, NULL, WNOHANG) > 0);
}

int main() {
if (getpid() != 1)
/* Not an error because pause sees use outside of infra containers. */
fprintf(stderr, "Warning: pause should be the first process in a pod\n");
fprintf(stderr, "Warning: pause should be the first process\n");

This comment has been minimized.

Copy link
@dbenhur

dbenhur May 18, 2017

Just deleting "in a pod" makes this warning confusing. Perhaps we should say "in a task" or "in a container group". It's certainly not the first process on the instance.

This comment has been minimized.

Copy link
@vsiddharth

vsiddharth May 18, 2017

Author Contributor

I agree with your comment but am not sure about customizing the warning for each abstraction?
We should come up with a warning that is fairly generic IMHO.

This comment has been minimized.

Copy link
@dbenhur

dbenhur May 18, 2017

Well, "container group" was my attempt to genericize. Both Tasks and Pods are groups of containers that are colocated on the same host and share a lifecycle.

This comment has been minimized.

Copy link
@samuelkarp

samuelkarp May 18, 2017

Contributor

I'd prefer to leave this as-is. Under normal circumstances, this error should not happen. If a customer manually launches pause in their own container, they'll see this error.


if (sigaction(SIGINT, &(struct sigaction){.sa_handler = sigdown}, NULL) < 0)
return 1;
Expand Down

0 comments on commit a0d6369

Please sign in to comment.