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

Detect if running inside a snap or on Ubuntu Core #3165

Merged
merged 1 commit into from
Oct 10, 2024

Conversation

benfrancis
Copy link
Member

@benfrancis benfrancis commented Sep 5, 2024

This is the first step in porting WebThings Gateway to Ubuntu Core.

Ubuntu Core does not ship with the lsb_release command so we have to add some snap-specific code to check for the existence of a distro ID in /var/lib/snapd/hostfs/etc/os-release, which relates to the host OS. See https://forum.snapcraft.io/t/hosts-lsb-release-but-core-os-release/24351/4

@benfrancis benfrancis changed the title Detect if running inside a snap or on Ubuntu Core WIP Detect if running inside a snap or on Ubuntu Core Sep 9, 2024
@benfrancis benfrancis changed the title WIP Detect if running inside a snap or on Ubuntu Core Detect if running inside a snap or on Ubuntu Core Sep 19, 2024
@benfrancis benfrancis marked this pull request as ready for review September 19, 2024 17:49
@benfrancis
Copy link
Member Author

@ogra1 Is this the cleanest way of doing this?

@dilyn-corner
Copy link
Contributor

dilyn-corner commented Oct 9, 2024

Yes, using the system-observe interface is indeed the best way for a snap to know what the actual host environment is.

@benfrancis benfrancis merged commit 4cba700 into WebThingsIO:master Oct 10, 2024
3 checks passed
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