<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Le 02/12/2016 à 02:53, Boris Rybalkin a
      écrit :<br>
    </div>
    <blockquote
cite="mid:CADcVQYs0R6uG-y60wbJZOWvkTKZKrb0LPEE1wUYXUqEpHg5GYA@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div>Sorry still more questions on hooks.<br>
            <br>
            As I understand configure hooks are executed after services
            startup:<br>
            <a moz-do-not-send="true"
href="https://github.com/snapcore/snapd/blob/3dc67f49c4b6fe3acd5add647ac35a42fbb395d5/overlord/snapstate/snapstate.go#L184">https://github.com/snapcore/snapd/blob/3dc67f49c4b6fe3acd5add647ac35a42fbb395d5/overlord/snapstate/snapstate.go#L184</a><br>
            <br>
          </div>
          If this is correct (and that is what I see) it completely
          breaks the idea of generating service configs (many tools want
          absolute paths in their configs) with configure hook as it has
          to be done before the start.<br>
          <br>
        </div>
        <div>This explains all my issues with keeping generated configs
          in SNAP_COMMON and every time I enable services and they fail
          I actually see configs from previous install :)<br>
        </div>
        <div><br>
        </div>
        Could anyone confirm this?<br>
      </div>
    </blockquote>
    <br>
    Hey Boris,<br>
    <br>
    This is correct.<br>
    <br>
    However, I think this forces some best practices on daemons.
    Remember that configure hooks can as well be executed while your
    process is running. Your process should be able to pick any
    configuration change and adapt accordingly.<br>
    So, the idea is to choose sane default, not rely on a configure file
    until the user chooses so, and diverge from their default (no config
    file or no key in the config file means default).<br>
    <br>
    That enables you to easily migrate defaults if you change them, as
    still enable people to choose their own configuration without being
    impacted by future default (note that ON (default) -> OFF ->
    ON switch, isn't a default anymore, it's a user choice.<br>
    <br>
    To illustrate that, I wrote a snap (codelab coming early next year)
    where a nodejs app have a default port and title. However, you can
    via "snap set" configure another port or title, and those changes
    are picked immediatly by the daemon without restarting. Note that I
    tried to have a generic configure hook, generating a key=value
    store, where setting "" value revert to default and keeping
    comments, ordering and other artefacts in your config<br>
<a class="moz-txt-link-freetext" href="https://github.com/ubuntu/snow-on-me-snap/blob/master/meta/hooks/configure">https://github.com/ubuntu/snow-on-me-snap/blob/master/meta/hooks/configure</a>
    for the config hook<br>
    <a class="moz-txt-link-freetext" href="https://github.com/ubuntu/snow-on-me-snap/blob/master/main.js#L71">https://github.com/ubuntu/snow-on-me-snap/blob/master/main.js#L71</a>
    for the nodejs webserver picking up new config on the fly.<br>
    <br>
    Hope that helps outlining why this behaviour shouldn't be a problem
    and why organizing your code that way is an advantage in the end
    (hoping you can act on the tools that requires this).<br>
    Didier<br>
    <br>
    <br>
    <blockquote
cite="mid:CADcVQYs0R6uG-y60wbJZOWvkTKZKrb0LPEE1wUYXUqEpHg5GYA@mail.gmail.com"
      type="cite">
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Fri, Nov 18, 2016 at 12:25 AM, Boris
          Rybalkin <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:ribalkin@gmail.com" target="_blank">ribalkin@gmail.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr">
              <div>After reinstalling snapd (2.17.1) and cleaning
                /var/lib/snapd/ issue seems to go away.<br>
              </div>
              Thank you very much!<br>
            </div>
            <div class="gmail_extra">
              <div>
                <div class="h5"><br>
                  <div class="gmail_quote">On Wed, Nov 16, 2016 at 7:20
                    PM, Boris Rybalkin <span dir="ltr"><<a
                        moz-do-not-send="true"
                        href="mailto:ribalkin@gmail.com" target="_blank">ribalkin@gmail.com</a>></span>
                    wrote:<br>
                    <blockquote class="gmail_quote" style="margin:0 0 0
                      .8ex;border-left:1px #ccc solid;padding-left:1ex">
                      <p dir="ltr">After upgrading snapd on desktop
                        16.04 from xenial-proposed now I have this wired
                        message on install:</p>
                      <p dir="ltr">Run configure hook of
                        "syncloud-platform"<br>
                        error: cannot perform the following tasks:<br>
                        - Run configure hook of "syncloud-platform" snap
                        if present (cannot snap-exec: cannot find hook
                        "configure" in "syncloud-platform")</p>
                      <p dir="ltr">snap --version                     <wbr>   
                        <br>
                        snap    2.17.1<br>
                        snapd   2.17.1<br>
                        series  16<br>
                        ubuntu  16.04</p>
                      <p dir="ltr">Has this changed since 2.17?</p>
                      <div class="m_-951478541800532539HOEnZb">
                        <div class="m_-951478541800532539h5">
                          <div class="gmail_extra"><br>
                            <div class="gmail_quote">On 14 Nov 2016
                              22:44, "Sergio Schvezov" <<a
                                moz-do-not-send="true"
                                href="mailto:sergio.schvezov@canonical.com"
                                target="_blank">sergio.schvezov@canonical.com</a><wbr>>
                              wrote:<br type="attribution">
                              <blockquote class="gmail_quote"
                                style="margin:0 0 0 .8ex;border-left:1px
                                #ccc solid;padding-left:1ex">El 14/11/16
                                a las 18:35, Boris Rybalkin escribió:<br>
                                <blockquote class="gmail_quote"
                                  style="margin:0 0 0
                                  .8ex;border-left:1px #ccc
                                  solid;padding-left:1ex">
                                  VM has snapd v2.17, is it possible to
                                  install this version on desktop
                                  16.04/16.10 so I can have it for
                                  integration tests?<br>
                                </blockquote>
                                <br>
                                It is in xenial-proposed <a
                                  moz-do-not-send="true"
                                  href="https://launchpad.net/ubuntu/+source/snapd"
                                  rel="noreferrer" target="_blank">https://launchpad.net/ubuntu/+<wbr>source/snapd</a><br>
                                If you want the latest and greatest at
                                all times (non production). If you do
                                this, follow the pinning process in <a
                                  moz-do-not-send="true"
                                  href="https://wiki.ubuntu.com/Testing/EnableProposed"
                                  rel="noreferrer" target="_blank">https://wiki.ubuntu.com/Testin<wbr>g/EnableProposed</a>
                                to pin snapd to xenial-proposed only and
                                not risk getting more (potentially
                                unstable) -proposed software.<br>
                                <br>
                                <blockquote class="gmail_quote"
                                  style="margin:0 0 0
                                  .8ex;border-left:1px #ccc
                                  solid;padding-left:1ex">
                                  Also is there any documentation on how
                                  to install snapd on a linux?<br>
                                </blockquote>
                                <br>
                                These are the installation instructions
                                available for the variety of distros
                                around:<br>
                                <a moz-do-not-send="true"
                                  href="http://snapcraft.io/docs/core/install"
                                  rel="noreferrer" target="_blank">http://snapcraft.io/docs/core/<wbr>install</a>,
                                in case you wonder where I got that link
                                from, it is available as a link on the
                                web front of <a moz-do-not-send="true"
                                  href="http://snapcraft.io"
                                  rel="noreferrer" target="_blank">http://snapcraft.io</a><br>
                                <br>
                                -- <br>
                                Snapcraft mailing list<br>
                                <a moz-do-not-send="true"
                                  href="mailto:Snapcraft@lists.snapcraft.io"
                                  target="_blank">Snapcraft@lists.snapcraft.io</a><br>
                                Modify settings or unsubscribe at: <a
                                  moz-do-not-send="true"
                                  href="https://lists.ubuntu.com/mailman/listinfo/snapcraft"
                                  rel="noreferrer" target="_blank">https://lists.ubuntu.com/mailm<wbr>an/listinfo/snapcraft</a><br>
                              </blockquote>
                            </div>
                          </div>
                        </div>
                      </div>
                    </blockquote>
                  </div>
                  <br>
                  <br clear="all">
                  <br>
                </div>
              </div>
              <span class="HOEnZb"><font color="#888888">-- <br>
                  <div class="m_-951478541800532539gmail_signature"
                    data-smartmail="gmail_signature">Boris Rybalkin<br>
                    <a moz-do-not-send="true"
                      href="mailto:ribalkin@gmail.com" target="_blank">ribalkin@gmail.com</a></div>
                </font></span></div>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <br>
        -- <br>
        <div class="gmail_signature" data-smartmail="gmail_signature">Boris
          Rybalkin<br>
          <a moz-do-not-send="true" href="mailto:ribalkin@gmail.com"
            target="_blank">ribalkin@gmail.com</a></div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
    </blockquote>
    <p><br>
    </p>
  </body>
</html>