#1089579 Wish: Please use Environment instead of EnvironmentFile in puppetserver.service

#1089579#5
Date:
2024-12-09 09:41:30 UTC
From:
To:
Dear Maintainer,

in the puppetserver.service file an EnvironmentFile= setting is used to
set needed environment variables from /etc/default/puppetserver.

But because of

"Settings from these files override settings made with Environment=. If
the same variable is set twice from these files, the files will be read
in the order they are specified and the later setting will override the
earlier setting."

(see systemd.exec(5)) it's more complicated than needed to override single environment
variables using an overlay file in
/etc/systemd/system/puppetserver.service.d, because it currently also
requires another file in /etc/default, because it requires another
EnvironmentFile setting.

Moving the environment variables directly into the service file would
allow to explicitly overwrite one or more of them by simply using a
systemd overlay file.

Thanks...

    Dirk

#1089579#10
Date:
2025-01-16 04:19:28 UTC
From:
To:
Hello,

Thanks for your bug report.

I'm hesitant to do this because it will diverge from upstream and add
the to maintenance burden because we'll need to monitor more closely to
changes in this file to ensure we replicate it in our custom systemd unit.

However, in your unit override, you can use "EnvironmentFile=" (empty
string) to instruct systemd to ignore "/etc/default/puppetserver". You
don't need to supply an extra dummy file.

#1089579#15
Date:
2025-01-16 04:19:28 UTC
From:
To:
Hello,

Thanks for your bug report.

I'm hesitant to do this because it will diverge from upstream and add
the to maintenance burden because we'll need to monitor more closely to
changes in this file to ensure we replicate it in our custom systemd unit.

However, in your unit override, you can use "EnvironmentFile=" (empty
string) to instruct systemd to ignore "/etc/default/puppetserver". You
don't need to supply an extra dummy file.