How to handle conffiles in snaps?

Christian Ehrhardt christian.ehrhardt at canonical.com
Tue Aug 9 07:29:01 UTC 2016


On Tue, Aug 9, 2016 at 9:01 AM, Nick Moffitt <nick.moffitt at canonical.com>
wrote:

> > You could still store conf files in SNAP_USER_DATA to get them writable
> > by the users of the system.
>
> Is there a good facility for install-time copying of template configs or
> other writeable-from-initial-state data into $SNAP_USER_DATA?
>
> The way snaps are invoked do a great job of hijacking the $*PATH
> variables used to find executables and shared objects, but often we need
> to hack in a lot of shuffling around for /usr/share and /etc and /var/
> to aim them at snappy's special directories.


Yeah, that is a good question as well.
As you said, for now there is a lot of hacking to get access to those and
since there is no defined way (I'd know of) to provide templates.
But there is no need every app (re-)implements such hacks that in some
other way.
So +1 for an official snapcraft/snap way to make files available in
$SNAP_USER_DATA and such.

I'd think of something like support for that in the copy plugin like
supporting:
parts:
 defaultconf:
   plugin: copy
   files:
       etc/example.conf: $SNAP_USER_DATA/etc/foo.conf

Surely there is some more magic glue involved as on "snap building time"
the path of $SNAP_USER_DATA and such isn't fix IIRC (could change per setup
and in future).
Worth a feature request bug? I'll wait for the discussion first.


-- 
Christian Ehrhardt
Software Engineer, Ubuntu Server
Canonical Ltd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/snapcraft/attachments/20160809/eacf4d1c/attachment-0001.html>


More information about the Snapcraft mailing list