Skip to content
This repository has been archived by the owner on Feb 24, 2020. It is now read-only.

rkt: return the pid of stage1 in "rkt status" #1699

Merged
merged 1 commit into from
Nov 2, 2015

Conversation

iaguis
Copy link
Member

@iaguis iaguis commented Oct 30, 2015

Instead of returning the PID of the process that's PID 1 inside the
container, we return the pid of the rkt process that started the pod.

Users can, for example, terminate the pod by sending SIGTERM to that PID
if the container was started with systemd-nspawn.

@iaguis
Copy link
Member Author

iaguis commented Oct 30, 2015

If we send SIGTERM to lkvm it exits with a failed exit status.

@@ -799,8 +799,17 @@ func getChildPID(ppid int) (int, error) {
return -1, ErrChildNotReady{}
}

// getPID returns the pid of the pod.
func (p *pod) getPID() (pid int, err error) {
// getPID returns the pid of the rkt process that started the pod.
Copy link
Contributor

Choose a reason for hiding this comment

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

rkt process seems confusing. It's actually the nspawn or kvm process, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe the stage1 process? Also for the title of the PR?

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, the rkt process execs nspawn or kvm so in a way it is the rkt process. But you're right, stage1 process is better.

@yifan-gu
Copy link
Contributor

LGTM, except for the naming in the comments

@iaguis iaguis changed the title rkt: return the pid of rkt in "rkt status" rkt: return the pid of stage1 in "rkt status" Nov 2, 2015
Instead of returning the PID of the process that's PID 1 inside the
container, we return the pid of the stage1 process that started the pod.

Users can, for example, terminate the pod by sending SIGTERM to that PID
if the container was started with systemd-nspawn.
yifan-gu added a commit that referenced this pull request Nov 2, 2015
rkt: return the pid of stage1 in "rkt status"
@yifan-gu yifan-gu merged commit 0d29981 into rkt:master Nov 2, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants