You probably want to create a configuration file. The location of the file is helpfully returned by running
inadyn.configpath
You need to edit this as root, because it’s saved into $SNAP_DATA for use by the daemon which is controlled by systemctl under the service name snap.inadyn.daemon.service.
It should be easy to edit the config with something like:
I tried to install the snap to a nextcloud box. The snap installs correctly, but I get errors will trying to configure the inadyn. Mainly that I do not have permissions to create the files and if I manage to create them, the inadyn can not access them. Could you write some instructions on how to configure the snap?
Sorry for the basic questions, but I am quite new to the snap technology.
I used pinano as snap for the nano-editor, because it was the only one available for the raspberry pi architecture. Do not pay attention on the configurations. I know that they are probably wrong, but one problem at time For the moment I can not save the configurations and have the snap read them.
And the output from the commands you provided:
...@...:~$ sudo journalctl snap.inadyn.daemon.service
Failed to add match 'snap.inadyn.daemon.service': Invalid argument
...@...:~$ sudo systemctl restart snap.inadyn.daemon.service
(This was succefull and did not produce any output, so I am pasting the output from the syslog)
...@...:~$ sudo tail -f /var/log/syslog
Nov 26 20:59:03 nextcloud systemd[1]: Started Service for snap application inadyn.daemon.
Nov 26 20:59:03 nextcloud kernel: [18981.549762] audit: type=1400 audit(1511729943.282:89): apparmor="DENIED" operation="chown" profile="snap.inadyn.daemon" name="/var/snap/inadyn/10/" pid=22015 comm="inadyn" requested_mask="w" denied_mask="w" fsuid=0 ouid=0
Nov 26 20:59:03 nextcloud inadyn[22015]: Not allowed to change owner of /var/snap/inadyn/10, aborting.
Nov 26 20:59:03 nextcloud systemd[1]: snap.inadyn.daemon.service: Main process exited, code=exited, status=73/n/a
Nov 26 20:59:03 nextcloud systemd[1]: snap.inadyn.daemon.service: Unit entered failed state.
Nov 26 20:59:03 nextcloud systemd[1]: snap.inadyn.daemon.service: Failed with result 'exit-code'.
Nov 26 20:59:03 nextcloud systemd[1]: snap.inadyn.daemon.service: Service hold-off time over, scheduling restart.
Nov 26 20:59:03 nextcloud systemd[1]: Stopped Service for snap application inadyn.daemon.
Nov 26 20:59:03 nextcloud systemd[1]: snap.inadyn.daemon.service: Start request repeated too quickly.
Nov 26 20:59:03 nextcloud systemd[1]: Failed to start Service for snap application inadyn.daemon.
The link you provided probably answers the question why this is happing. Probably the pinano does not have the permissions to write the necessary configurations files (Am I correct???). Is there a way of bypassing this restriction?
Is there a way of resolving that??? In the syslog, I saw the message that your are mentioning. I did not understand what I have to do from the links Although not new to linux, I am really new to snaps and unfortunately did not have the chance to play with them yet
I would guess that the pinano snap does not have permission from apparmor and seccomp snap confinement to access the /var/snap/inadyn directory which is why you can’t write the file using that. To work around it, you could write the file on your normal PC and scp /path/to/inadyn.conf yourpiusername@pi.ip.add.ress:~ and then login to the pi via ssh and sudo mv inadyn.conf /var/snap/inadyn/10/inadyn.conf.
The currently easiest way to get working is to run:
sudo snap refresh --devmode --revision=10 inadyn
which will turn-off the confinement. Note that this will mean that the snap will be able to access your entire system, so you might prefer not to follow this advice if you’re keen to maintain the security of your system.
This resolves all the problems for both inadyn and pinano Since this breaks the purpose of having snaps, could you suggest me some material to read and learn in the process about snaps? What would be generally the correct procedure for configuring a snap???
Thank you in advance and sorry for this basic questions
"
As mentioned elsewhere, this will be fixed as part of the work for Multiple users and groups in snaps. This work is on the roadmap but not prioritized. To help out, I’m working on this in the background so while it is progressing, it is progressing slowly. Note that chown to root:root is currently allowed.