Re: Accpetance of Environment Variables in Attributes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 26, 2020 at 3:39 AM Ede Wolf <listac@xxxxxxxxxxxxxxxx> wrote:
>
> > 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.
>
> Would you mind to explain, what is the benefit of this approach compared
> to having a dedicated unit file for each service?

When you have multiple instances of a service which differ only
slightly (for example, the launch directory and service name), it's
very convenient to have all of the common settings in a single file
and only provide the *differences* in drop-in files. Systemd's
handling of templates and instances makes this very easy to do. It's
not necessary though, you can certainly duplicate all of the
configuration in the unit files, including setting necessary
environment variables.
_______________________________________________
systemd-devel mailing list
systemd-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/systemd-devel



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux