<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 12 January 2017 at 11:33, Stuart Bishop <span dir="ltr"><<a href="mailto:stuart.bishop@canonical.com" target="_blank">stuart.bishop@canonical.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"><br><div class="gmail_extra"><div class="gmail_quote"><span class="">On 12 January 2017 at 02:31, Charles Butler <span dir="ltr"><<a href="mailto:charles.butler@canonical.com" target="_blank">charles.butler@canonical.com</a>></span> wrote:<br></span><div>You don't have much control over the generated systemd service file. Its an open issue. So while you could have your snap accept configuration options, the snap can't rewrite its own systemd service file (or it could escape its containment). What you would need to do is write a wrapper for bin/etcd that sets the environment variables (pulled from snap configuration, or from a .ini file or similar stored in $SNAP_DATA or $SNAP_COMMON) before os.exec'ing the real bin/etcd<br></div></div></div></div></blockquote><div><br></div><div>(and if you choose this approach, you of course need your charm to restart the service when you change the config. snapd can't do that for you, yet. Well, maybe the config handler is able to restart the service but I suspect confinement would block that attempt)<br> <br><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Since you are driving this from a charm though, you don't need it. systemd supports '.d' style directories, allowing you to extend a .service file owned by some other process. This is how the snap layer adds support for downloading snaps via proxies, so see <a href="https://git.launchpad.net/layer-snap/tree/reactive/snap.py#n62" target="_blank">https://git.launchpad.net/<wbr>layer-snap/tree/reactive/snap.<wbr>py#n62</a> for an example.<span class="HOEnZb"><font color="#888888"><br></font></span></div></div><span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"></span></div></blockquote></div><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Stuart Bishop <<a href="mailto:stuart.bishop@canonical.com" target="_blank">stuart.bishop@canonical.com</a>></div>
</div></div>