[systemd-devel] Accpetance of Environment Variables in Attributes

Kevin P. Fleming kevin at km6g.us
Thu Jun 25 22:11:45 UTC 2020


On Thu, Jun 25, 2020 at 4:04 PM Ede Wolf <listac at nebelschwaden.de> wrote:
> This way I would only have to take care of _one_ external file to get
> another instance of service foo up and running. Copy the file, change
> the few options for the unit as well as for the service in ONE place,
> startup the template. Ultra elegant and fast, especially when dealing
> with 10+ instances of the same service, that only have little variation
> like the running user, limits and one or two different service arguments.

I do this today using a drop-in, because environment variables can be
set there as well. It works very well, exactly as you describe. There
is a template service unit file, and a drop-in directory for each
instance which contains a file that sets the environment variables and
also provides values for keys in the [Unit] and [Service] sections.


More information about the systemd-devel mailing list