On Fr, 24.07.20 00:12, Roman Odaisky (r...@qwertty.com) wrote:

> Hi All,
>
> Suppose I want to run a number of similar services that all require the same
> boilerplate. How to avoid repeating myself when creating unit files?

Three options:

1. Use templating, works great if you have a single parameter

2. Use drop-ins, i.e. define separate unit files for each instance,
   listing only the stuff that actually differs in each instance,
   and pull in the common stuff via a drop-in you symlink into the .d/
   subdir of each instance. Covers things nicely, but of course only
   works to override or extend full lines.

3. Use a template engine/macro language of your choosing, such as m4 or so.

> Let’s take a concrete example, websites. The boilerplate is as follows:
>
> [Unit]
> After=syslog.target

No need for this, it's not needed anymore today.

> StandardError=syslog

Also remove this line.

Lennart

--
Lennart Poettering, Berlin
_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to