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

avoid setting NOTIFY_SOCKET from calling process #54

Merged
merged 1 commit into from
Sep 11, 2019

Conversation

tonistiigi
Copy link
Member

@tonistiigi tonistiigi commented Sep 9, 2019

Having NOTIFY_SOCKET set mutates the spec in runc in unexpected way. As this feature is for running runc with systemd it doesn't have use for go-runc.

related to moby/moby#39866

@crosbymichael

Signed-off-by: Tonis Tiigi [email protected]

@crosbymichael
Copy link
Member

Can you rebase on master to pick up the fix for travis plz?

@codecov-io
Copy link

codecov-io commented Sep 10, 2019

Codecov Report

Merging #54 into master will decrease coverage by 0.08%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #54      +/-   ##
=========================================
- Coverage    6.12%   6.03%   -0.09%     
=========================================
  Files           7       7              
  Lines         637     646       +9     
=========================================
  Hits           39      39              
- Misses        591     600       +9     
  Partials        7       7
Impacted Files Coverage Δ
command_linux.go 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b4bc25a...c0c55f3. Read the comment docs.

@crosbymichael
Copy link
Member

LGTM

command_linux.go Outdated
continue loop0
}
}
out = append(in, v)
Copy link
Member

Choose a reason for hiding this comment

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

I guess this should be out = append(out, v) :)

Copy link
Member

@fuweid fuweid left a comment

Choose a reason for hiding this comment

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

LGTM

@AkihiroSuda
Copy link
Member

Can we rather fix the issue on runc side?

@@ -32,10 +33,24 @@ func (r *Runc) command(context context.Context, args ...string) *exec.Cmd {
cmd.SysProcAttr = &syscall.SysProcAttr{
Setpgid: r.Setpgid,
}
cmd.Env = os.Environ()
cmd.Env = filterEnv(os.Environ(), "NOTIFY_SOCKET") // NOTIFY_SOCKET introduces a special behavior in runc but should only be set if invoked from systemd
Copy link
Member

Choose a reason for hiding this comment

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

Non-systemd can set this

Copy link
Member

Choose a reason for hiding this comment

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

I think NOTIFY_SOCKET env is from systemd and I meet the error before. 😂

Copy link
Member

Choose a reason for hiding this comment

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

ignore me...

Copy link
Member

Choose a reason for hiding this comment

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

I think the NOTIFY_SOCKET is used for daemon running in the background. go-runc is just like a tool and I think it is ok to remove it.

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 fine with runc having a special mode for mounting extra things into container but it needs to be more explicit. Then if this feature is found to be useful for go-runc, it can have a special option for it.

@tonistiigi
Copy link
Member Author

tonistiigi commented Sep 11, 2019

Can we rather fix the issue on runc side?

I would be for it but we do need something for a patch release as well and as this affects tools like buildkit and containerd it isn't always very easy to control what runc binary they use.

@AkihiroSuda AkihiroSuda merged commit e029b79 into containerd:master Sep 11, 2019
dmcgowan pushed a commit to thaJeztah/docker that referenced this pull request Oct 4, 2019
- github.com/containerd/go-runc containerd/go-runc@7d11b49...e029b79
  - containerd/go-runc#52 Fix Method of judging command execution failure
    - fixes "init.pid: no such file or directory: unknown" errors
  - containerd/go-runc#54 avoid setting NOTIFY_SOCKET from calling process

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Derek McGowan <[email protected]>
docker-jenkins pushed a commit to docker-archive/docker-ce that referenced this pull request Oct 8, 2019
- github.com/containerd/go-runc containerd/go-runc@7d11b49...e029b79
  - containerd/go-runc#52 Fix Method of judging command execution failure
    - fixes "init.pid: no such file or directory: unknown" errors
  - containerd/go-runc#54 avoid setting NOTIFY_SOCKET from calling process

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Derek McGowan <[email protected]>
Upstream-commit: 1617be92d301de1386adabad5f241d3653b6c8ff
Component: engine
burnMyDread pushed a commit to burnMyDread/moby that referenced this pull request Oct 21, 2019
- github.com/containerd/go-runc containerd/go-runc@7d11b49...e029b79
  - containerd/go-runc#52 Fix Method of judging command execution failure
    - fixes "init.pid: no such file or directory: unknown" errors
  - containerd/go-runc#54 avoid setting NOTIFY_SOCKET from calling process

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Derek McGowan <[email protected]>
Signed-off-by: zach <[email protected]>
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.

None yet

5 participants