-
Notifications
You must be signed in to change notification settings - Fork 2
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
Improved snap support #44
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Two small fixes.
Dynamic edge localhost:<port>/status support for snaps. Assuming that if environment variable SNAP is found, we're running as snap.
This code is ONLY being used in that file anyway and this also nicely removes the problem of having two files with the same name in the codebase (causes problems with snapcraft).
A very minimal test for create-dev-identity.sh
Update CHANGELOG.md, update version info.
Snap gets recognized if the SNAP -env variable is in use. Others we simply try by trying the port and seeing if we can find end-point name record with jq.
This is due to the restricted access rights, you cannot give a snap permission to look into anything /proc/. = AppArmor = Time: May 5 18:17:09 Log: apparmor="DENIED" operation="open" profile="snap.pelion-edge.edge-info" name="/proc/13793/cmdline" pid=16216 comm="pgrep" requested_mask="r" denied_mask="r" fsuid=0 ouid=1000 File: /proc/13793/cmdline (read) Suggestion: * adjust program to not access '@{PROC}/@{pid}/cmdline'
Try a different path in the case of snap.
Add some snapcraft.io related URLs that can be tested. Not all of them respond to ping, though. Ref: https://snapcraft.io/docs/network-requirements
Try RFILE="/var/snap/pelion-edge/current/userdata/relaystatics.sh" as we seem to have trouble with the earlier version (permission denied).
Removed the need for the relaystatics.sh file - the cached values it provided can be easily worked out every time. (cherry picked from commit 774b23f) Signed-off-by: Janne Kiiskilä <[email protected]>
We can just use jq. We should be able to get snap version directly from ${SNAP_VERSION}.
Set base path depending on where you find edge-core application. Prepare for wiwgwag -free use cases, too. Print out a bunch of SNAP info as well for good measure.
It fails on LmP, even though we include ncurses (at least for me now). You gets lots of errors for not finding that command. But, we do not need it!
Add note about checking snapcraft.io addresses as well, if running as a snap.
petedyerarm
approved these changes
May 16, 2023
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Todos
shellcheck
orpysh-check
before committing code - no more warnings than earlier (preferrably less)