I’ve been trying to give my snap package access to the system files through the interface. My program is able to read the files but it seems to struggle with modifying it. I install it from a local file (so I have to use
--dangerous flag). I also connect the interface using
snap connect shellsnake:config-shellsnake
Is there something I’m missing? Interestingly when I run the program with superuser rights it is able to write into the files without an issue. Please find the snapcraf.yaml file below.
Thank you very much!
name: shellsnake # you probably want to 'snapcraft register <name>' base: core20 # the base snap is the execution environment for this snap version: '0.2' # just for humans, typically '1.2+git' or '1.3.2' summary: a simple game # 79 char long summary description: | A simple terminal based game for Linux. grade: stable #must be 'stable' to release into candidate/stable channels confinement: strict #use 'strict' once you have the right plugs and slots parts: shellsnake: # See 'snapcraft plugins' plugin: cmake source: . build-packages: - libgtest-dev - libncurses5-dev stage-packages: - libncursesw5 layout: /var/shellsnake/settings.bin: bind-file: $SNAP_DATA/var/lib/shellsnake/settings.bin /var/shellsnake/scores.bin: bind-file: $SNAP_DATA/var/lib/shellsnake/scores.bin /usr/local/share/shellsnake/logo.txt: bind-file: $SNAP/usr/local/share/shellsnake/logo.txt plugs: config-shellsnake: interface: system-files write: - /var/shellsnake/settings.bin - /var/shellsnake/scores.bin apps: shellsnake: command: usr/local/bin/snake plugs: - config-shellsnake