I have created Producer snap with Writeable content slot. I have two consumer snap with plug to them. When I try to write i.e copy files in the consumer snap to the writeable folder, it doesn’t allow it to write. If I write via a process in the consumer snap, it is able to write files in the writeable content.
Can you clarify how to write/copy files to the writeable content by a consumer snap?
-rwxrwxr-x 1 root root 58 Feb 21 05:12 slot-exec.sh
cp: cannot create regular file ‘/snap/plug1/x1/slot-writeable/./test.out’: Read-only file system
I am the slot-side executable running!
well, you are exporting a place from a readonly (squashfs) filesystem, what do you expect ?
Instead of $SNAP/slot-writable try to export $SNAP_DATA/slot-writeable (or SNAP_COMMON if you do not want it to be versioned) … and if you want non-root users to be able to write, SNAP_USER_DATA or SNAP_USER_COMMON … or indeed any dir underneath these paths …