And updated doco for the install hook -------------------- CURRENT “install”
The install hook is called upon initial install, before any services contained by the snap are started. If the hook exits non-zero, the installation of the snap will fail. Example Before running the snapcraft command to build your snap, this install file should be placed at this location: <snap project>/snap/hooks/install. #!/bin/sh set -e # Run any commands needed to setup the snap. # This could be downloading a list of dynamic configuration options or creating a database. ---------------- SUGGESTED “install” The install hook is called the snaps installation has completed but before before any services contained by the snap are started. If the 'install' hook exits non-zero, the installation of the snap will fail causing a full rollback. The install hook can be used to run any commands needed as part of the setup, such as creating or upgrading a database or downloading dynamically configured files. You can also provide some initial default values for the key/value store by calling: snapctl set <key>=<value> The install script lives along side the configure script at: <snap project>/snap/hooks/install Example #!/bin/sh set -e snapctl set username=daemon_user snapctl set password=<generate random password> # Run any commands needed to setup the snap. # This could be downloading a list of dynamic configuration options or creating a database. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1745066 Title: Snap documatation of hook changes To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/snap/+bug/1745066/+subscriptions -- ubuntu-bugs mailing list [email protected] https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
