<div dir="ltr"><p dir="ltr"><span style="line-height:1.5">On Thu, Jul 14, 2016, 19:07 Kai Hendry <</span><a href="mailto:hendry@webconverger.com" target="_blank" style="line-height:1.5">hendry@webconverger.com</a><span style="line-height:1.5">> wrote:</span><br></p><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I would love to see that 10 lines of shell you claimed, but I think you<br>
might be underestimating the fine work that went into Dokku!<br></blockquote><div><br></div><div><span style="line-height:1.5">It's not so much underestimating the work in Dokku as much as leveraging what systemd and a tool like haproxy provide for services.</span></div><div><br></div><div>Here's what a script would do with no socket activation, assuming you're sending traffic to the services with a tool like haproxy and have an interface like a control socket [1]:</div><div><ol><li><span style="line-height:1.5">Tell haproxy to stop sending traffic to service instance A.</span><br></li><li><span style="line-height:1.5">systemctl restart instance-a.service</span></li><li><span style="line-height:1.5">Tell haproxy to start sending traffic to service instance A and stop to B.<br></span></li><li><span style="line-height:1.5">systemctl restart instance-b.service</span></li><li><span style="line-height:1.5">Tell haproxy to start sending traffic to service instance B.<br></span></li></ol><div>Alternatively, you could track state of a flip-flop and stabilize on only one service instance at a time after the restart.</div><div><br></div><div>[1] <a href="https://cbonte.github.io/haproxy-dconv/configuration-1.5.html#9.2">https://cbonte.github.io/haproxy-dconv/configuration-1.5.html#9.2</a></div></div></div></div>