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

hookstate: run the right "snap" command in the hookmanager #2992

Merged
merged 2 commits into from Mar 7, 2017

Conversation

Projects
None yet
3 participants
@mvo5
Collaborator

mvo5 commented Mar 7, 2017

When the hook manager needs to run "snap run" it needs to run the right snap command. As this is happening inside snapd the "no-reexec" environment is already set. So just running "snap" may lead to running the old "snap" command which will result in (very) confusing errors, c.f. #1668738

The alternative to this might be something like:

+               // clear env so that subsequent snap commands run from
+               // inside will not see this
+               os.Unsetenv("SNAP_DID_REEXEC")

but that won't work with older versions of snapd that did not differentiate between the user setting to disable re-exec and the internal setting to indicate that re-exec already happend.

@mvo5

This comment has been minimized.

Show comment
Hide comment
@mvo5

mvo5 Mar 7, 2017

Collaborator

If the theory about #1668738 is correct we just need this branch and we can close #2985

Collaborator

mvo5 commented Mar 7, 2017

If the theory about #1668738 is correct we just need this branch and we can close #2985

@niemeyer

Thanks!

@pedronis

looks good, small nitpick

Show outdated Hide outdated testutil/exec.go Outdated

@niemeyer niemeyer merged commit ddf20fc into snapcore:master Mar 7, 2017

6 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
xenial-amd64 autopkgtest finished (success)
Details
xenial-i386 autopkgtest finished (success)
Details
xenial-ppc64el autopkgtest finished (success)
Details
yakkety-amd64 autopkgtest finished (success)
Details
zesty-amd64 autopkgtest finished (success)
Details

mvo5 added a commit to mvo5/snappy that referenced this pull request Mar 8, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment