Snapping CUPS Printing Stack: Avahi support, system users/groups

I am Till Kamppeter, leader of the OpenPrinting project, upstream maintainer of cups-filters, and packager for the printing stack in Ubuntu.
Some months ago I have started snapping the printing stack, making a snap containing CUPS, cups-filters, and MuPDF. This should give printing functionality to a Ubuntu Core system (or a Snap-based desktop/server) for both allowing printing in the local network from the system and creating print server appliances.
When I did this I ran into two major problems:
1. Avahi (DNS-SD) supoort
To be able to print on printers in the local network one needs to discover them and the current, universally accepted standard for that is DNS-SD. The implementation of DNS-SD on Linux and many other free software operating systems is Avahi.
Our printing stack uses Avahi in two directions: As a client, where our printing stack browses Avahi recorrds of remote servers to find printers to print on and as a server, so that our printing stack can share local printers.
Are there already interfaces for a snap to do that? If so, please post links to documentation and examples on how to use them. If not, pleae tell me how to do a feature request.
What does the interface ā€œavahi-observeā€ do and how do I use it?
2. Non privileged system users/groups
CUPS uses some system users and groups for its internal workings. Most important is the ā€œlpā€ user. CUPS runs filters (external utilities to convert file formats for printing) and most backends (external utilities to communicate with printer hardware) as the unprivileged user ā€œlpā€ (whereas the CUPS daemon itself runs as root) for security reasons. ā€œlpā€ is member of the group ā€œlpā€ so that one can make printer device files group-writable for the ā€œlpā€ group.
There is also the ā€œlpadminā€ groups. Not only root can do CUPS administration (creating/modifying/removing print queues, manipulating any userā€™s jobs) but also all the users of the ā€œlpadminā€ group.
The names are not hard-coded in CUPS. They can be modified (for example if it is easier to implement with names starting with ā€œsnap_ā€¦ā€).
Here I would like how to do this in snaps. I have seen a recent thread here discussing this, but it seemed only discussion of ideas. Is there already implemented something?
There is a ā€œcups-controlā€ interface which looks like that snaps using it can do the tasks which members of the ā€œlpadminā€ group can do (but with a classically installed CUPS). Am I right? How does this interface work? I would like to have this interface acting on the CUPS snap.
Any help is welcome.

Link to the discussion about users and groups in snaps.

Till

Related bug report: Launchpad bug #1606510: Mechanism to create system groups.

Till

From: https://github.com/snapcore/snapd/wiki/Interfaces ā€œCan browse for mDNS/DNS-SD services on the network via Avahi.ā€

This isnā€™t enough for what youā€™d need, however, there is a PR in review that you might be interested in: https://github.com/snapcore/snapd/pull/3624

Not yet, but the design is almost there: Multiple users and groups in snaps

I can say that part of implementing this design will be doing seccomp policy to allow using uids and gids, and the first uid/gid that will be allowed is the system ā€˜daemonā€™ user/group which is not dependent on the rest of the design (in fact, the only reason why it isnā€™t implemented yet is because of the various issues with rolling out new seccomp policy that are finally addressed in snapd 2.26.14).

This interface (currently) allows nothing more than the cups-client apparmor abstraction (ie, connecting to the cups socket) and group membership is not mediated by snapd but instead enforced by the cupsd daemon. It is only available on classic. To be available on core, youā€™d have to extend the cups-control interface in a similar manner as the aforementioned PR for avahi to allow a slot implementation snap to run as cupsd and allow connections to it.

1 Like

Is there a chance that weā€™ll see a very simple cups-server snap to be used on Ubuntu Core ?

Simply running as root, accessing /dev/lp* or /dev/usblp* and listening on the network for print jobs (even setting up the PPDs and such could be handled via a local command shipped in the snap) ?

I.e. without any fancy desktop integration or anything, to replace the multiple print servers in my house (that run a headless minimal install on beagleboards today) with UbuntuCore ā€¦

@ondra, I have found your work on the avahi snap

I have cloned this GIT and built and installed it to get the newest version of the Avahi snap. CUPS and cups-browsed connect to avahi-daemon via D-Bus using the libavahiā€¦ libraries, CUPS for sharing local and discovering remote printers, cups-browsed only for discovering remote printers.

Ho do I make my CUPS snap using the avahi snap? A simple ā€œPlugs: [network, network-bind, daemon-dbus]ā€ for the cups and cups-browsed apps does not work, there is no auto connection (I would like to have one) and manually connecting via

sudo snap connect cups:daemon-dbus avahi

tells that I have no plug named ā€œdbus-daemonā€.

Till

Hi @till.kamppeter
I abandoned use of dbus interface as this did not pass review in store. There is already avahi-observe interface to use, but itā€™s limited only to classic systems, so instead I choose to re-work existing interface. It will work also on Ubuntu Core and there is additional interface avahi- control
When this will land, your cups will connect to avahi:avahi-observe or avahi:avahi-control
What you found in git is old attempt, once interface lands I will commit also changes in avahi

@ondra, thank you very much for this update. How long will this take more or less until it is ready, as the CUPS snap is blocked on this?

your guess is as good as mine, but zyga has just reviewed it and gave it +1 so we are now pending on Jamieā€™s review

@till.kamppeter interface just landed to edge
I have updated git repo as well and new avahi snap is now waiting for manual review in store.
in the mean time, you can get new avahi snaps from here: avahi-snap and install it with ā€”dangerous

@till.kamppeter ups sorry does bot look like itā€™s yet in edge, but should be by tomorrow

@till.kamppeter new interface is now in edge, and new avahi is under manual review, once itā€™s passed, I will release it to edge

FYI, this is done now (I was waiting for a store pull for a newer review tools, which is why it took a little longer than usual).

1 Like

Thanks.
I am trying it out now. What do I need to add to snapcraft.yaml that my CUPS package automatically connects to the interfaces of avahi? I need to connect to discover network printers advertised via Avahi and I also want to advertise printers via Avahi so that other machines discover them.
I also want that when installing the CUPS snaps all interface connections, including Avahi are done automatically.

You donā€™t need to do anything in your snapcraft.yaml beyond declaring the plugs and slots you want to use. When you have a snap in the store, you can request interfaces be auto-connected by following the process outlined in Process for aliases, auto-connections and tracks

The state of the art of my CUPS snap is always here:

git clone git@github.com:OpenPrinting/printing-stack-snap.git

I have taken the stable Core Snap on a Virtual Machine Manager VM (libvirt/QEMU), upgraded it to Edge and installed the Edge version of the Avahi Snap into it. Then I clean-built the CUPS snap based on said GIT repo, scp-ed it into the Ubuntu Core virtual machine, and installed it. Installation worked, cupsd and cups-browsed are running, and I can access with CUPSā€™ command line tools.
What does not work is Avahi, in the Core VM I do not see the printers of my host machine.
@ondra, can you have a look what is going wrong here?

hi @till.kamppeter
to be honest Iā€™m not expert on avahi, I just snapped it and wrote interfaces.
Iā€™d suggest to repeat same testing with classic + classic avahi and see if that works. If that does work, then we can focus on where snap confinement is breaking it.
Also are you sure this VM setup is supposed to work? From my experience itā€™s depends on network rules how well mdns works on given network.

I have now tried to install the snap on a classic system. For that I have used the snap as it is on the GitHub, changed the port in default.yaml to 10631 (so that the snapā€™s CUPS runs in parallel with the systemā€™s CUPS, this worked formerly) and in snapcraft.yaml I removed daemon-dbus, avahi-observe, avahi-control from all the plugs; ... lines of all the apps: as the appropriate slots are not available on the classic system.

I can build and install the snap without problems, but cupsd and cups-browsed are not starting. /var/log/syslog shows the following:

Oct 26 10:41:37 till-x1carbon systemd[1]: Reloading.
Oct 26 10:41:37 till-x1carbon systemd[1]: Mounting Mount unit for cups...
Oct 26 10:41:37 till-x1carbon systemd[1]: Mounted Mount unit for cups.
Oct 26 10:41:37 till-x1carbon kernel: [ 2676.929194] audit: type=1400 audit(1509021697.696:150): apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="unconfined" name="snap.cups.cups-browsed" pid=1807 comm="apparmor_parser"
Oct 26 10:41:37 till-x1carbon kernel: [ 2677.003170] audit: type=1400 audit(1509021697.770:151): apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="unconfined" name="snap.cups.cupsd" pid=1809 comm="apparmor_parser"
Oct 26 10:41:37 till-x1carbon kernel: [ 2677.074978] audit: type=1400 audit(1509021697.842:152): apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="unconfined" name="snap.cups.lp" pid=1811 comm="apparmor_parser"
Oct 26 10:41:37 till-x1carbon kernel: [ 2677.153521] audit: type=1400 audit(1509021697.920:153): apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="unconfined" name="snap.cups.lpadmin" pid=1813 comm="apparmor_parser"
Oct 26 10:41:37 till-x1carbon kernel: [ 2677.229418] audit: type=1400 audit(1509021697.996:154): apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="unconfined" name="snap.cups.lpinfo" pid=1815 comm="apparmor_parser"
Oct 26 10:41:38 till-x1carbon kernel: [ 2677.319463] audit: type=1400 audit(1509021698.086:155): apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="unconfined" name="snap.cups.lpoptions" pid=1817 comm="apparmor_parser"
Oct 26 10:41:38 till-x1carbon kernel: [ 2677.394621] audit: type=1400 audit(1509021698.161:156): apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="unconfined" name="snap.cups.lpstat" pid=1820 comm="apparmor_parser"
Oct 26 10:41:38 till-x1carbon snapd[983]: 2017/10/26 10:41:38.217609 cmd.go:133: exe doesn't have snap mount dir prefix: "/usr/lib/snapd/snapd" vs "/snap"
Oct 26 10:41:38 till-x1carbon kernel: [ 2677.448660] audit: type=1400 audit(1509021698.214:157): apparmor="STATUS" operation="profile_load" profile="unconfined" name="snap.cups.mutool" pid=1822 comm="apparmor_parser"
Oct 26 10:41:38 till-x1carbon kernel: [ 2677.750710] audit: type=1400 audit(1509021698.516:158): apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="unconfined" name="/snap/core/3247/usr/lib/snapd/snap-confine" pid=1869 comm="apparmor_parser"
Oct 26 10:41:38 till-x1carbon kernel: [ 2677.750888] audit: type=1400 audit(1509021698.516:159): apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="unconfined" name="/snap/core/3247/usr/lib/snapd/snap-confine//mount-namespace-capture-helper" pid=1869 comm="apparmor_parser"
Oct 26 10:41:38 till-x1carbon systemd[1]: Reloading.
Oct 26 10:41:38 till-x1carbon systemd[1]: Started Service for snap application cups.cups-browsed.
Oct 26 10:41:38 till-x1carbon systemd[1]: Started Service for snap application cups.cupsd.
Oct 26 10:41:39 till-x1carbon cups.cupsd[1914]: perl: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by /snap/cups/x1/lib/x86_64-linux-gnu/libcrypt.so.1)
Oct 26 10:41:39 till-x1carbon cups.cupsd[1914]: message repeated 3 times: [ perl: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by /snap/cups/x1/lib/x86_64-linux-gnu/libcrypt.so.1)]
Oct 26 10:41:39 till-x1carbon systemd[1]: snap.cups.cupsd.service: Main process exited, code=exited, status=1/FAILURE
Oct 26 10:41:39 till-x1carbon systemd[1]: snap.cups.cupsd.service: Unit entered failed state.
Oct 26 10:41:39 till-x1carbon systemd[1]: snap.cups.cupsd.service: Failed with result 'exit-code'.
Oct 26 10:41:39 till-x1carbon cups.cups-browsed[1901]: /snap/cups/x1/usr/sbin/cups-browsed: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by /snap/cups/x1/lib/x86_64-linux-gnu/libcrypt.so.1)
Oct 26 10:41:39 till-x1carbon cups.cups-browsed[1901]: /snap/cups/x1/usr/sbin/cups-browsed: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by /snap/cups/x1/lib/x86_64-linux-gnu/libsystemd.so.0)
Oct 26 10:41:39 till-x1carbon systemd[1]: snap.cups.cups-browsed.service: Main process exited, code=exited, status=1/FAILURE
Oct 26 10:41:39 till-x1carbon systemd[1]: snap.cups.cups-browsed.service: Unit entered failed state.
Oct 26 10:41:39 till-x1carbon systemd[1]: snap.cups.cups-browsed.service: Failed with result 'exit-code'.
Oct 26 10:41:39 till-x1carbon systemd[1]: snap.cups.cupsd.service: Service hold-off time over, scheduling restart.
Oct 26 10:41:39 till-x1carbon systemd[1]: Stopped Service for snap application cups.cupsd.
Oct 26 10:41:39 till-x1carbon systemd[1]: Started Service for snap application cups.cupsd.
Oct 26 10:41:39 till-x1carbon cups.cupsd[1991]: perl: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by /snap/cups/x1/lib/x86_64-linux-gnu/libcrypt.so.1)
Oct 26 10:41:39 till-x1carbon cups.cupsd[1991]: message repeated 3 times: [ perl: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by /snap/cups/x1/lib/x86_64-linux-gnu/libcrypt.so.1)]
Oct 26 10:41:39 till-x1carbon systemd[1]: snap.cups.cupsd.service: Main process exited, code=exited, status=1/FAILURE
Oct 26 10:41:39 till-x1carbon systemd[1]: snap.cups.cupsd.service: Unit entered failed state.
Oct 26 10:41:39 till-x1carbon systemd[1]: snap.cups.cupsd.service: Failed with result 'exit-code'.
Oct 26 10:41:39 till-x1carbon systemd[1]: snap.cups.cups-browsed.service: Service hold-off time over, scheduling restart.
Oct 26 10:41:39 till-x1carbon systemd[1]: snap.cups.cupsd.service: Service hold-off time over, scheduling restart.
Oct 26 10:41:39 till-x1carbon systemd[1]: Stopped Service for snap application cups.cupsd.
Oct 26 10:41:39 till-x1carbon systemd[1]: Started Service for snap application cups.cupsd.
Oct 26 10:41:39 till-x1carbon systemd[1]: Stopped Service for snap application cups.cups-browsed.
Oct 26 10:41:39 till-x1carbon systemd[1]: Started Service for snap application cups.cups-browsed.
Oct 26 10:41:39 till-x1carbon cups.cupsd[2047]: perl: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by /snap/cups/x1/lib/x86_64-linux-gnu/libcrypt.so.1)
Oct 26 10:41:39 till-x1carbon cups.cupsd[2047]: message repeated 3 times: [ perl: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by /snap/cups/x1/lib/x86_64-linux-gnu/libcrypt.so.1)]
Oct 26 10:41:39 till-x1carbon cups.cups-browsed[2051]: /snap/cups/x1/usr/sbin/cups-browsed: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by /snap/cups/x1/lib/x86_64-linux-gnu/libcrypt.so.1)
Oct 26 10:41:39 till-x1carbon systemd[1]: snap.cups.cupsd.service: Main process exited, code=exited, status=1/FAILURE
Oct 26 10:41:39 till-x1carbon systemd[1]: snap.cups.cupsd.service: Unit entered failed state.
Oct 26 10:41:39 till-x1carbon systemd[1]: snap.cups.cupsd.service: Failed with result 'exit-code'.
Oct 26 10:41:39 till-x1carbon cups.cups-browsed[2051]: /snap/cups/x1/usr/sbin/cups-browsed: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by /snap/cups/x1/lib/x86_64-linux-gnu/libsystemd.so.0)
Oct 26 10:41:39 till-x1carbon systemd[1]: snap.cups.cups-browsed.service: Main process exited, code=exited, status=1/FAILURE
Oct 26 10:41:39 till-x1carbon systemd[1]: snap.cups.cups-browsed.service: Unit entered failed state.
Oct 26 10:41:39 till-x1carbon systemd[1]: snap.cups.cups-browsed.service: Failed with result 'exit-code'.
Oct 26 10:41:40 till-x1carbon systemd[1]: snap.cups.cupsd.service: Service hold-off time over, scheduling restart.
Oct 26 10:41:40 till-x1carbon systemd[1]: snap.cups.cups-browsed.service: Service hold-off time over, scheduling restart.
Oct 26 10:41:40 till-x1carbon systemd[1]: Stopped Service for snap application cups.cups-browsed.
Oct 26 10:41:40 till-x1carbon systemd[1]: Started Service for snap application cups.cups-browsed.
Oct 26 10:41:40 till-x1carbon systemd[1]: Stopped Service for snap application cups.cupsd.
Oct 26 10:41:40 till-x1carbon systemd[1]: Started Service for snap application cups.cupsd.
Oct 26 10:41:40 till-x1carbon cups.cupsd[2123]: perl: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by /snap/cups/x1/lib/x86_64-linux-gnu/libcrypt.so.1)
Oct 26 10:41:40 till-x1carbon cups.cupsd[2123]: message repeated 2 times: [ perl: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by /snap/cups/x1/lib/x86_64-linux-gnu/libcrypt.so.1)]
Oct 26 10:41:40 till-x1carbon cups.cups-browsed[2122]: /snap/cups/x1/usr/sbin/cups-browsed: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by /snap/cups/x1/lib/x86_64-linux-gnu/libcrypt.so.1)
Oct 26 10:41:40 till-x1carbon cups.cups-browsed[2122]: /snap/cups/x1/usr/sbin/cups-browsed: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by /snap/cups/x1/lib/x86_64-linux-gnu/libsystemd.so.0)
Oct 26 10:41:40 till-x1carbon cups.cupsd[2123]: perl: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by /snap/cups/x1/lib/x86_64-linux-gnu/libcrypt.so.1)
Oct 26 10:41:40 till-x1carbon systemd[1]: snap.cups.cups-browsed.service: Main process exited, code=exited, status=1/FAILURE
Oct 26 10:41:40 till-x1carbon systemd[1]: snap.cups.cups-browsed.service: Unit entered failed state.
Oct 26 10:41:40 till-x1carbon systemd[1]: snap.cups.cups-browsed.service: Failed with result 'exit-code'.
Oct 26 10:41:40 till-x1carbon systemd[1]: snap.cups.cupsd.service: Main process exited, code=exited, status=1/FAILURE
Oct 26 10:41:40 till-x1carbon systemd[1]: snap.cups.cupsd.service: Unit entered failed state.
Oct 26 10:41:40 till-x1carbon systemd[1]: snap.cups.cupsd.service: Failed with result 'exit-code'.
Oct 26 10:41:40 till-x1carbon systemd[1]: snap.cups.cups-browsed.service: Service hold-off time over, scheduling restart.
Oct 26 10:41:40 till-x1carbon systemd[1]: snap.cups.cupsd.service: Service hold-off time over, scheduling restart.
Oct 26 10:41:40 till-x1carbon systemd[1]: Stopped Service for snap application cups.cupsd.
Oct 26 10:41:40 till-x1carbon systemd[1]: Started Service for snap application cups.cupsd.
Oct 26 10:41:40 till-x1carbon systemd[1]: Stopped Service for snap application cups.cups-browsed.
Oct 26 10:41:40 till-x1carbon systemd[1]: Started Service for snap application cups.cups-browsed.
Oct 26 10:41:40 till-x1carbon cups.cupsd[2197]: perl: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by /snap/cups/x1/lib/x86_64-linux-gnu/libcrypt.so.1)
Oct 26 10:41:40 till-x1carbon cups.cupsd[2197]: message repeated 3 times: [ perl: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by /snap/cups/x1/lib/x86_64-linux-gnu/libcrypt.so.1)]
Oct 26 10:41:40 till-x1carbon systemd[1]: snap.cups.cupsd.service: Main process exited, code=exited, status=1/FAILURE
Oct 26 10:41:40 till-x1carbon systemd[1]: snap.cups.cupsd.service: Unit entered failed state.
Oct 26 10:41:40 till-x1carbon systemd[1]: snap.cups.cupsd.service: Failed with result 'exit-code'.
Oct 26 10:41:40 till-x1carbon cups.cups-browsed[2198]: /snap/cups/x1/usr/sbin/cups-browsed: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by /snap/cups/x1/lib/x86_64-linux-gnu/libcrypt.so.1)
Oct 26 10:41:40 till-x1carbon cups.cups-browsed[2198]: /snap/cups/x1/usr/sbin/cups-browsed: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by /snap/cups/x1/lib/x86_64-linux-gnu/libsystemd.so.0)
Oct 26 10:41:40 till-x1carbon systemd[1]: snap.cups.cups-browsed.service: Main process exited, code=exited, status=1/FAILURE
Oct 26 10:41:40 till-x1carbon systemd[1]: snap.cups.cups-browsed.service: Unit entered failed state.
Oct 26 10:41:40 till-x1carbon systemd[1]: snap.cups.cups-browsed.service: Failed with result 'exit-code'.
Oct 26 10:41:40 till-x1carbon systemd[1]: snap.cups.cupsd.service: Service hold-off time over, scheduling restart.
Oct 26 10:41:40 till-x1carbon systemd[1]: snap.cups.cups-browsed.service: Service hold-off time over, scheduling restart.
Oct 26 10:41:40 till-x1carbon systemd[1]: Stopped Service for snap application cups.cups-browsed.
Oct 26 10:41:40 till-x1carbon systemd[1]: Started Service for snap application cups.cups-browsed.
Oct 26 10:41:40 till-x1carbon systemd[1]: Stopped Service for snap application cups.cupsd.
Oct 26 10:41:40 till-x1carbon systemd[1]: snap.cups.cupsd.service: Start request repeated too quickly.
Oct 26 10:41:40 till-x1carbon systemd[1]: Failed to start Service for snap application cups.cupsd.
Oct 26 10:41:40 till-x1carbon systemd[1]: snap.cups.cupsd.service: Unit entered failed state.
Oct 26 10:41:40 till-x1carbon systemd[1]: snap.cups.cupsd.service: Failed with result 'exit-code'.
Oct 26 10:41:40 till-x1carbon cups.cups-browsed[2262]: /snap/cups/x1/usr/sbin/cups-browsed: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by /snap/cups/x1/lib/x86_64-linux-gnu/libcrypt.so.1)
Oct 26 10:41:40 till-x1carbon cups.cups-browsed[2262]: /snap/cups/x1/usr/sbin/cups-browsed: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by /snap/cups/x1/lib/x86_64-linux-gnu/libsystemd.so.0)
Oct 26 10:41:40 till-x1carbon systemd[1]: snap.cups.cups-browsed.service: Main process exited, code=exited, status=1/FAILURE
Oct 26 10:41:40 till-x1carbon systemd[1]: snap.cups.cups-browsed.service: Unit entered failed state.
Oct 26 10:41:40 till-x1carbon systemd[1]: snap.cups.cups-browsed.service: Failed with result 'exit-code'.
Oct 26 10:41:40 till-x1carbon systemd[1]: snap.cups.cups-browsed.service: Service hold-off time over, scheduling restart.
Oct 26 10:41:40 till-x1carbon systemd[1]: Stopped Service for snap application cups.cups-browsed.
Oct 26 10:41:40 till-x1carbon systemd[1]: snap.cups.cups-browsed.service: Start request repeated too quickly.
Oct 26 10:41:40 till-x1carbon systemd[1]: Failed to start Service for snap application cups.cups-browsed.
Oct 26 10:41:40 till-x1carbon systemd[1]: snap.cups.cups-browsed.service: Unit entered failed state.
Oct 26 10:41:40 till-x1carbon systemd[1]: snap.cups.cups-browsed.service: Failed with result 'exit-code'.

Problem seems to be these messages with version GLIBC_2.25ā€™ not found`. Is this known? What can be wrong here?

Note also that I did not start to confine yet. My confinement is still devmode. At first I want to get it to work at all.

few things
first on classic avahi-observe and avahi-control are both provided by core snap as desktop system would have avahi preinstalled. If you are using server version there is no avahi preinstalled so you can either install it from deb or you can install snap version.
Now to your app problem:
perl: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.25 not found (required by /snap/cups/x1/lib/x86_64-linux-gnu/libcrypt.so.1)
this line is key, what you are you building on? Core snap is based on 16.04 which has glibc-2.23
Try to recompile your snap on system with glibc-2.23, so you link against correct version.
Does not look like avahi related problem at all. But letā€™s see