cups interface is connected
* snap-exec: fix detection if `cups` interface is connected The cups interface needs a way to set the environment variable `CUPS_SERVER` if the `cups` interface is connected. However we have no mechanism for setting environment vars based on interface connections currently. To workaround this, the cups work added a workaround in `snap-exec` that tried to detect if `cups` is connected and when it is set the environment. Unfortunately the code in there was too simplistic because it just checked if the directory `/var/cups` exists. However ths dir now always exists because it's needed as the mount point. This commit fixes the detection by checking if `/var/cups` is a bind mount. This is checked by looking at the `stat()` data and the `dev_t` field in there. If they differ it means the bind mount exists and the only thing that creates this bind mount is the `cups` `MountConnectedPlug()` code. This is not great but it fixes the spread failure we see in the `cups-control` test (which is a real bug) and should be good enough until we have a proper interface backend that can set environment variables. * tests: re-enable interfaces-cups-control test For unclear reasons the error message on unplug changes when I run this on my 20.04 system so I updated the tests - it most likely because the test-snapd-cups-control-consumer snap moved from core16 to core20 a week ago but that is not 100% confirmed. * snap-exec: fix unit test for CUPS_SERVER workaround
Welcome to snapd
This is the code repository for snapd, the background service that manages and maintains installed snaps.
Snaps are app packages for desktop, cloud and IoT that update automatically, are easy to install, secure, cross-platform and dependency-free. They're being used on millions of Linux systems every day.
Alongside its various service and management functions, snapd:
- provides the snap command that's used to install and remove snaps and interact with the wider snap ecosystem
- implements the confinement policies that isolate snaps from the base system and from each other
- governs the interfaces that allow snaps to access specific system resources outside of their confinement
For general details, including installation and Getting started guides, head over to our Snap documentation. If you're looking for something to install, such as Spotify or Visual Studio Code, take a look at the Snap Store. And if you want to build your own snaps, start with our Creating a snap documentation.
Get involved
This is an open source project and we warmly welcome community contributions, suggestions, and constructive feedback. If you're interested in contributing, please take a look at our Code of Conduct first.
- to report an issue, please file a bug report on our Launchpad issue tracker
- for suggestions and constructive feedback, create a post on the Snapcraft forum
- to build snapd manually, or to get started with snapd development, see HACKING.md
Get in touch
We're friendly! We have a community forum at https://forum.snapcraft.io where we discuss feature plans, development news, issues, updates and troubleshooting. You can chat in realtime with the snapd team and our wider community on the #snappy IRC channel on libera chat.
For news and updates, follow us on Twitter and on Facebook.
Project status
| Service | Status |
|---|---|
| Github Actions | |
| GoReport | |
| Codecov |