<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Feb 26, 2016 at 3:06 PM, Terry Burton <span dir="ltr"><<a href="mailto:tez@terryburton.co.uk" target="_blank">tez@terryburton.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi,<br>
<br>
I have an application that in part consists of a number of instances<br>
of similar processes (each with their own configuration and bound to<br>
neighbouring ports, etc.)<br>
<br>
I could create a .service file for each instance from a template but<br>
I'm wondering whether systemd has some built-in way of handling this<br>
situation. Maybe something akin to generators but for services based<br>
on a template and with fewer early-boot requirements?<br>
<br>
Previously I had a single init script (init.d.fake/app-N) to which I<br>
pointed a symlink for each instance (e.g. init.d/app-5) and the init<br>
script would extract the instance number from $0. So only a single<br>
file to maintain. Systemd seems just a little more awkward.<br></blockquote><div><br></div><div><a href="https://www.freedesktop.org/software/systemd/man/systemd.unit.html">https://www.freedesktop.org/software/systemd/man/systemd.unit.html</a> – search for "instance". You're looking for %i and the `app@.service` syntax.</div></div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Mantas Mikulėnas <<a href="mailto:grawity@gmail.com" target="_blank">grawity@gmail.com</a>></div></div>
</div></div>