@Ian how do you do that? I tried the following in a test snap and it didn't work (after connecting the interface):
name: testsnap version: "1.0" summary: testsnap description: testsnap architectures: - amd64 base: core18 confinement: strict grade: stable
plugs: read-system-os-release: interface: system-files read: - /var/lib/snapd/hostfs/etc/os-release
apps: testsnap: command: script plugs: - read-system-os-release
where "script" does the following:
#!/bin/bash
for file in /etc/os-release /var/lib/snapd/hostfs/etc/os-release; do echo "------- $file" cat "$file" echo "-------" done
After connecting "testsnap:read-system-os-release" I still get:
$ testsnap ------- /etc/os-release NAME="Ubuntu Core" VERSION="18" ID=ubuntu-core PRETTY_NAME="Ubuntu Core 18" VERSION_ID="18" HOME_URL="https://snapcraft.io/" BUG_REPORT_URL="http://bugs.launchpad.net/snappy/" ------- ------- /var/lib/snapd/hostfs/etc/os-release cat: /var/lib/snapd/hostfs/etc/os-release: Permission denied -------
@Ian how do you do that? I tried the following in a test snap and it didn't work (after connecting the interface):
name: testsnap
version: "1.0"
summary: testsnap
description: testsnap
architectures:
- amd64
base: core18
confinement: strict
grade: stable
plugs: system- os-release: snapd/hostfs/ etc/os- release
read-
interface: system-files
read:
- /var/lib/
apps: os-release
testsnap:
command: script
plugs:
- read-system-
where "script" does the following:
#!/bin/bash
for file in /etc/os-release /var/lib/ snapd/hostfs/ etc/os- release; do
echo "------- $file"
cat "$file"
echo "-------"
done
After connecting "testsnap: read-system- os-release" I still get:
$ testsnap /snapcraft. io/" bugs.launchpad. net/snappy/" snapd/hostfs/ etc/os- release snapd/hostfs/ etc/os- release: Permission denied
------- /etc/os-release
NAME="Ubuntu Core"
VERSION="18"
ID=ubuntu-core
PRETTY_NAME="Ubuntu Core 18"
VERSION_ID="18"
HOME_URL="https:/
BUG_REPORT_URL="http://
-------
------- /var/lib/
cat: /var/lib/
-------