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

Improved snap support #44

Merged
merged 16 commits into from
May 16, 2023
Merged

Improved snap support #44

merged 16 commits into from
May 16, 2023

Conversation

JanneKiiskila
Copy link
Contributor

@JanneKiiskila JanneKiiskila commented May 16, 2023

Todos

JanneKiiskila and others added 15 commits May 5, 2023 13:41
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!
@JanneKiiskila JanneKiiskila mentioned this pull request May 16, 2023
5 tasks
@JanneKiiskila JanneKiiskila changed the title Edge port fix Improved snap support May 16, 2023
Add note about checking snapcraft.io addresses as well, if running as a snap.
Copy link
Contributor

@petedyerarm petedyerarm left a comment

Choose a reason for hiding this comment

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

LGTM

@JanneKiiskila JanneKiiskila merged commit 3484234 into master May 16, 2023
@JanneKiiskila JanneKiiskila deleted the edge-port-fix branch May 16, 2023 20:28
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.

2 participants