-
Notifications
You must be signed in to change notification settings - Fork 562
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
osutil: switch to -u UID:GID for strace-static #13950
Conversation
@@ -50,8 +50,8 @@ var ExcludedSyscalls = getExcludedSyscalls() | |||
|
|||
func findStrace(u *user.User) (stracePath string, userOpts []string, err error) { | |||
if path := filepath.Join(dirs.SnapMountDir, "strace-static", "current", "bin", "strace"); osutil.FileExists(path) { | |||
// strace-static cannot resolve usernames, pass uid/gid instead | |||
return path, []string{"--uid", u.Uid, "--gid", u.Gid}, nil | |||
// Strace v6.9 supports -u UID:GID which avoids the need to resolve usernames with nss. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it required v6.9 just help me understand, do we bundle strace-static or how are we fulfilling this requirement?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah right, looking more at this it needs the snap to be installed before this works?
What happens if I have an old strace snap?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two cases:
- you have the
strace-static
snap, just refresh or it doesn't work - you don't have the snap - this never worked then
There are about 200-300 users of strace-static, I think it's fine to do it without any extra complexity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The snap is currently building. Once it reaches candidate, I will re-trigger tests. |
The candidate channel is now ready (except for ppc and i386 which are EOL) |
This moves us off the custom patch and onto an upstream feature we've heled develop. The feature is not released yet but the patch has been integrated into the strace-static snap. Jira: SNAPDENG-19870 Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
The test tried to carefully match the error message to the version of strace used, which in turn depends on the host OS. It's much easier to just check both error mesages. Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
f34c3a5
to
346d123
Compare
@bboozzoo please re-review the last patch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
On systemd 255 systemctl kill fails after attempting to kill snapd.service with the following message: $ sudo systemctl kill --signal=SIGKILL snapd.service Failed to kill unit snapd.service: Failed to send signal SIGKILL to auxiliary processes: Invalid argument Kill the pid by hand to avoid triggering this behavior. Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
This moves us off the custom patch and onto an upstream feature we've heled develop. The feature is not released yet but the patch has been integrated into the strace-static snap.
canonical/strace-static-snap#3
Jira: SNAPDENG-19870