Access to /dev/lp0

Hi, I’m trying to create an application to run on Ubuntu Core22 with Frame and be able to print on the thermal printer connected via parallel port /dev/lp0. However the printing only works when I snap install with --devmode. Some kind of permission problem which I tried many things but unable to solve.

The output of sudo journalctl | grep pos3 | grep DENIED yields:

AVC apparmor="DENIED" operation="open" profile="snap.pos3.pos3" name="/usr/share/fonts/Plymouth.ttf" pid=4034 comm="io.flutter.ui" requested_mask="r" denied_mask="r" fsuid=0 ouid=0

My snapcraft.yaml:

name: pos3
base: core22
version: '0.1'
summary: Yet another Point-of-Sales terminal
description: Yet another Point-of-Sales terminal
compression: lzo
grade: stable
confinement: strict

apps:
  pos3:
    command: pos3
    extensions: [gnome]
    plugs: [network, raw-usb]

parts:
  pos3:
    source: .
    plugin: flutter

architectures:
  - build-on: amd64

Any help much appreciated. Thanks.

While your journalctl command above is great to catch denials, better use snappy-debug (from the same named snap) instead, that will even make suggestions what interface plug to add to your snap :wink: