<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <div class="moz-cite-prefix">On 10/27/2016 08:59 AM, Aaron Ogle
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAGX5j1xsGdHv5JDFhC6ZyEJpxTLrTSkR+MQmGCYzf9ejv26Ctg@mail.gmail.com"
      type="cite">
      <div dir="ltr">Didier:
        <div><br>
        </div>
        <div>With each upgrade we perform a database migration.  So when
          reverting back the data structure in the database might have
          changed.  This is potentially something we could handle inside
          of our platform specifically.  But figured I would ask :)<br>
        </div>
      </div>
    </blockquote>
    <br>
    So are you storing this database in $SNAP_COMMON? Because $SNAP_DATA
    would do this for you, no?<br>
    <br>
    <blockquote
cite="mid:CAGX5j1xsGdHv5JDFhC6ZyEJpxTLrTSkR+MQmGCYzf9ejv26Ctg@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div><br>
          <div class="gmail_quote">
            <div dir="ltr">On Thu, Oct 27, 2016 at 10:53 AM Didier Roche
              <<a moz-do-not-send="true"
                href="mailto:didrocks@ubuntu.com">didrocks@ubuntu.com</a>>
              wrote:<br>
            </div>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <div bgcolor="#FFFFFF" text="#000000" class="gmail_msg">
                <div class="m_5854810902815697935moz-cite-prefix
                  gmail_msg">Le 27/10/2016 à 17:33, Aaron Ogle a écrit :<br
                    class="gmail_msg">
                </div>
                <blockquote type="cite" class="gmail_msg">
                  <div dir="ltr" class="gmail_msg">Didier:
                    <div class="gmail_msg"><br class="gmail_msg">
                    </div>
                    <div class="gmail_msg">This sounds like exactly what
                      I wanted!  So once this lands I will be able to
                      just use: <span class="gmail_msg">snapctl get
                        value</span> to get user set information?</div>
                  </div>
                </blockquote>
              </div>
              <div bgcolor="#FFFFFF" text="#000000" class="gmail_msg">
                Exactly!</div>
              <div bgcolor="#FFFFFF" text="#000000" class="gmail_msg"><br
                  class="gmail_msg">
                <br class="gmail_msg">
                <blockquote type="cite" class="gmail_msg">
                  <div dir="ltr" class="gmail_msg">
                    <div class="gmail_msg"><br class="gmail_msg">
                    </div>
                    <div class="gmail_msg">Will the snapctl command be
                      available anywhere in the snap or only in the
                      hooks?</div>
                  </div>
                </blockquote>
                <br class="gmail_msg">
              </div>
              <div bgcolor="#FFFFFF" text="#000000" class="gmail_msg"> I
                guess the main intent is to use them primarily in hooks,
                but nothing should prevent it to be available in your
                other snap daemon as well (as it's part of the core
                rootfs).</div>
              <div bgcolor="#FFFFFF" text="#000000" class="gmail_msg"><br
                  class="gmail_msg">
                <br class="gmail_msg">
                <blockquote type="cite" class="gmail_msg">
                  <div dir="ltr" class="gmail_msg">
                    <div class="gmail_msg"><br class="gmail_msg">
                    </div>
                    <div class="gmail_msg">Also the upgrade hook looks
                      like it could be a thing of beauty. Any plans for
                      a downgrade hook?</div>
                  </div>
                </blockquote>
                <br class="gmail_msg">
              </div>
              <div bgcolor="#FFFFFF" text="#000000" class="gmail_msg"> I
                don't know about any plan for that, I'll let others
                answer. I think you mean a downgrade hook being executed
                after a snap revert to fetch back "newer data" that
                could be lost in the revert process and transfer back to
                the older version? Or do you have any other use case in
                mind?</div>
              <div bgcolor="#FFFFFF" text="#000000" class="gmail_msg"><br
                  class="gmail_msg">
                <br class="gmail_msg">
                Didier</div>
              <div bgcolor="#FFFFFF" text="#000000" class="gmail_msg"><br
                  class="gmail_msg">
                <blockquote type="cite" class="gmail_msg"><br
                    class="gmail_msg">
                  <div class="gmail_quote gmail_msg">
                    <div dir="ltr" class="gmail_msg">On Thu, Oct 27,
                      2016 at 10:14 AM Didier Roche <<a
                        moz-do-not-send="true"
                        href="mailto:didrocks@ubuntu.com"
                        class="gmail_msg" target="_blank">didrocks@ubuntu.com</a>>
                      wrote:<br class="gmail_msg">
                    </div>
                    <blockquote class="gmail_quote gmail_msg"
                      style="margin:0 0 0 .8ex;border-left:1px #ccc
                      solid;padding-left:1ex">Le 27/10/2016 à 16:50,
                      Aaron Ogle a écrit :<br class="gmail_msg">
                      > Greetings,<br class="gmail_msg">
                      ><br class="gmail_msg">
                      > With our Rocket.Chat snap, we're looking to
                      be able to allow someone<br class="gmail_msg">
                      > to run an external mongodb instead of the
                      built in one.  As well as<br class="gmail_msg">
                      > we'd like to add something like caddy /
                      traefik etc to do ssl<br class="gmail_msg">
                      > termination.  But its not a daemon we would
                      want enabled out of the<br class="gmail_msg">
                      > box because of the effect on existing users.<br
                        class="gmail_msg">
                      ><br class="gmail_msg">
                      > So basically looking for a way let the user
                      of a snap enable or<br class="gmail_msg">
                      > disable two different daemons in our snap.<br
                        class="gmail_msg">
                      ><br class="gmail_msg">
                      > Is this possible using anything out of the
                      box?  Or would I have to<br class="gmail_msg">
                      > make the command ran in the daemon look at an
                      environment variable /<br class="gmail_msg">
                      > file etc. and determine if it should make the
                      daemon just exit?<br class="gmail_msg">
                      ><br class="gmail_msg">
                      > How have others handled this?  Or allowing
                      users to customize snap<br class="gmail_msg">
                      > behaviour?<br class="gmail_msg">
                      <br class="gmail_msg">
                      Hey Aaron,<br class="gmail_msg">
                      <br class="gmail_msg">
                      sounds like a great plan for usability!<br
                        class="gmail_msg">
                      <br class="gmail_msg">
                      I would suggest using configure hooks to proceed
                      that. Hooks are just a<br class="gmail_msg">
                      way for users to set variable=value. Based on
                      that, you can control your<br class="gmail_msg">
                      daemon with a configure script (triggered by this
                      command) inside your<br class="gmail_msg">
                      snap. This one can triggers start and stop inside
                      a mongodb daemon<br class="gmail_msg">
                      wrapper (waiting for a certain value to be passed
                      for instance before<br class="gmail_msg">
                      executing the real daemon).<br class="gmail_msg">
                      <br class="gmail_msg">
                      The documentation is not yet published on <a
                        moz-do-not-send="true"
                        href="http://snapcraft.io" rel="noreferrer"
                        class="gmail_msg" target="_blank">snapcraft.io</a>
                      AFAIK, but is<br class="gmail_msg">
                      available there:<br class="gmail_msg">
                      <a moz-do-not-send="true"
                        href="https://github.com/snapcore/snapd/blob/master/docs/hooks.md"
                        rel="noreferrer" class="gmail_msg"
                        target="_blank">https://github.com/snapcore/snapd/blob/master/docs/hooks.md</a>.<br
                        class="gmail_msg">
                      <br class="gmail_msg">
                      However, please keep in mind about this bug<br
                        class="gmail_msg">
                      <a moz-do-not-send="true"
                        href="https://bugs.launchpad.net/snappy/+bug/1636931"
                        rel="noreferrer" class="gmail_msg"
                        target="_blank">https://bugs.launchpad.net/snappy/+bug/1636931</a>,
                      we need a new core image<br class="gmail_msg">
                      to have snapctl available from your snap, and so,
                      you won't be able to<br class="gmail_msg">
                      experiment it right away.<br class="gmail_msg">
                      <br class="gmail_msg">
                      I'll probably write a codelab on this precise
                      topic in a couple of weeks<br class="gmail_msg">
                      FYI (once the feature is really available to users
                      and developers).<br class="gmail_msg">
                      Cheers,<br class="gmail_msg">
                      Didier<br class="gmail_msg">
                      <br class="gmail_msg">
                      <br class="gmail_msg">
                      --<br class="gmail_msg">
                      Snapcraft mailing list<br class="gmail_msg">
                      <a moz-do-not-send="true"
                        href="mailto:Snapcraft@lists.snapcraft.io"
                        class="gmail_msg" target="_blank">Snapcraft@lists.snapcraft.io</a><br
                        class="gmail_msg">
                      Modify settings or unsubscribe at: <a
                        moz-do-not-send="true"
                        href="https://lists.ubuntu.com/mailman/listinfo/snapcraft"
                        rel="noreferrer" class="gmail_msg"
                        target="_blank">https://lists.ubuntu.com/mailman/listinfo/snapcraft</a><br
                        class="gmail_msg">
                    </blockquote>
                  </div>
                  <div dir="ltr" class="gmail_msg">-- <br
                      class="gmail_msg">
                  </div>
                  <div data-smartmail="gmail_signature"
                    class="gmail_msg">
                    <div dir="ltr" class="gmail_msg">
                      <div class="gmail_msg"><br class="gmail_msg">
                      </div>
                      <div class="gmail_msg">
                        <table
                          style="color:rgb(0,0,0);font-family:verdana;font-size:medium"
                          class="gmail_msg" border="0" cellpadding="0"
                          cellspacing="0">
                          <tbody class="gmail_msg">
                            <tr class="gmail_msg">
                              <td style="padding-right:15px"
                                class="gmail_msg"> <img
                                  moz-do-not-send="true"
                                  src="https://cdn-download.rocket.chat/email-signature.png?v=3"
style="width:80px;display:block;margin-left:10px" class="gmail_msg"> </td>
                              <td
style="padding-left:15px;border-left-width:1px;border-left-style:solid;border-left-color:rgb(240,240,240)"
                                class="gmail_msg" valign="top">
                                <table
                                  style="border-collapse:collapse;font-size:12px;margin-top:4px"
                                  class="gmail_msg" border="0"
                                  cellpadding="3" cellspacing="0"
                                  width="100%">
                                  <tbody class="gmail_msg">
                                    <tr class="gmail_msg">
                                      <td style="padding:3px 0px
10px;margin:0px;font-family:verdana,geneva,sans-serif;font-size:12px;color:rgb(86,97,120)"
                                        class="gmail_msg"> <b
                                          style="display:block;font-size:12px"
                                          class="gmail_msg">Aaron Ogle</b>
                                        <span
                                          style="color:rgb(153,153,153);font-size:10px;display:block"
                                          class="gmail_msg">Core
                                          Developer</span> </td>
                                    </tr>
                                    <tr class="gmail_msg">
                                      <td style="padding:0px 0px
                                        2px;margin:0px"
                                        class="gmail_msg">
                                        <p
                                          style="margin:0px;padding:0px"
                                          class="gmail_msg"><a
                                            moz-do-not-send="true"
                                            href="mailto:aaron.ogle@rocket.chat"
style="color:rgb(156,160,172);font-size:10px" class="gmail_msg"
                                            target="_blank">aaron.ogle@rocket.chat</a></p>
                                      </td>
                                    </tr>
                                    <tr class="gmail_msg">
                                    </tr>
                                    <tr class="gmail_msg">
                                      <td style="padding:0px 0px
                                        2px;margin:0px"
                                        class="gmail_msg">
                                        <p
                                          style="margin:0px;padding:0px"
                                          class="gmail_msg"><a
                                            moz-do-not-send="true"
                                            href="https://demo.rocket.chat/direct/aaron.ogle"
style="color:rgb(156,160,172);font-size:10px" class="gmail_msg"
                                            target="_blank">@aaron.ogle</a></p>
                                      </td>
                                    </tr>
                                    <tr class="gmail_msg">
                                      <td style="padding:0px 0px
                                        2px;margin:0px"
                                        class="gmail_msg">
                                        <p
                                          style="margin:0px;padding:0px"
                                          class="gmail_msg"><a
                                            moz-do-not-send="true"
                                            href="https://rocket.chat"
                                            style="color:rgb(156,160,172);font-size:10px"
                                            class="gmail_msg"
                                            target="_blank">https://rocket.chat</a></p>
                                      </td>
                                    </tr>
                                  </tbody>
                                </table>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </div>
                  </div>
                  <br class="gmail_msg">
                  <fieldset
                    class="m_5854810902815697935mimeAttachmentHeader
                    gmail_msg"></fieldset>
                  <br class="gmail_msg">
                </blockquote>
                <p class="gmail_msg"><br class="gmail_msg">
                </p>
              </div>
              --<br class="gmail_msg">
              Snapcraft mailing list<br class="gmail_msg">
              <a moz-do-not-send="true"
                href="mailto:Snapcraft@lists.snapcraft.io"
                class="gmail_msg" target="_blank">Snapcraft@lists.snapcraft.io</a><br
                class="gmail_msg">
              Modify settings or unsubscribe at: <a
                moz-do-not-send="true"
                href="https://lists.ubuntu.com/mailman/listinfo/snapcraft"
                rel="noreferrer" class="gmail_msg" target="_blank">https://lists.ubuntu.com/mailman/listinfo/snapcraft</a><br
                class="gmail_msg">
            </blockquote>
          </div>
        </div>
      </div>
      <div dir="ltr">-- <br>
      </div>
      <div data-smartmail="gmail_signature">
        <div dir="ltr">
          <div><br>
          </div>
          <div>
            <table
              style="color:rgb(0,0,0);font-family:verdana;font-size:medium"
              border="0" cellpadding="0" cellspacing="0">
              <tbody>
                <tr>
                  <td style="padding-right:15px"> <img
                      moz-do-not-send="true"
                      src="https://cdn-download.rocket.chat/email-signature.png?v=3"
                      style="width: 80px; display: block; margin-left:
                      10px;"> </td>
                  <td
style="padding-left:15px;border-left-width:1px;border-left-style:solid;border-left-color:rgb(240,240,240)"
                    valign="top">
                    <table
                      style="border-collapse:collapse;font-size:12px;margin-top:4px"
                      border="0" cellpadding="3" cellspacing="0"
                      width="100%">
                      <tbody>
                        <tr>
                          <td style="padding:3px 0px
10px;margin:0px;font-family:verdana,geneva,sans-serif;font-size:12px;color:rgb(86,97,120)">
                            <b style="display:block;font-size:12px">Aaron
                              Ogle</b> <span
                              style="color:rgb(153,153,153);font-size:10px;display:block">Core
                              Developer</span> </td>
                        </tr>
                        <tr>
                          <td style="padding:0px 0px 2px;margin:0px">
                            <p style="margin:0px;padding:0px"><a
                                moz-do-not-send="true"
                                href="mailto:aaron.ogle@rocket.chat"
                                style="color:rgb(156,160,172);font-size:10px"
                                target="_blank">aaron.ogle@rocket.chat</a></p>
                          </td>
                        </tr>
                        <tr>
                        </tr>
                        <tr>
                          <td style="padding:0px 0px 2px;margin:0px">
                            <p style="margin:0px;padding:0px"><a
                                moz-do-not-send="true"
                                href="https://demo.rocket.chat/direct/aaron.ogle"
style="color:rgb(156,160,172);font-size:10px" target="_blank">@aaron.ogle</a></p>
                          </td>
                        </tr>
                        <tr>
                          <td style="padding:0px 0px 2px;margin:0px">
                            <p style="margin:0px;padding:0px"><a
                                moz-do-not-send="true"
                                href="https://rocket.chat"
                                style="color:rgb(156,160,172);font-size:10px"
                                target="_blank">https://rocket.chat</a></p>
                          </td>
                        </tr>
                      </tbody>
                    </table>
                  </td>
                </tr>
              </tbody>
            </table>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Kyle Fazzari (kyrofa)
Software Engineer
Canonical Ltd.
<a class="moz-txt-link-abbreviated" href="mailto:kyle@canonical.com">kyle@canonical.com</a></pre>
  </body>
</html>