Right now I have systemd service files with 20+ environment variables in them, expressed as Environment=
This is a lot of duplication that I would like to git rid of since I have systemd files for celery, gunicorn, and celerybeat.
I'd like to have one file that is included
into each of the unit files and it appears one way to do this is like this:
The correct way to do this is to create a directory named after the unit file with .d appended on the end. So for a unit called example.service, a subdirectory called example.service.d could be created. Within this directory a file ending with .conf can be used to override or extend the attributes of the system’s unit file.
But that still has me trapped in the name of the file matching the service name. My first thought was to symlink all of the services to the same folder so that gunicorn.d
is a link to celery.d
is a link to celerybeat.d
. That way every service would have the same file and the only extra setup would be to create the links.
So, should I do that with Symlinks at the directory level or hard links at the file level under those directories.
OR am I going about this completely wrong and there is some super simple method to deal with this that I just haven't found.