On Wed, Mar 17 2021 at 11:08:35 +0100, Antoine Jacoutot wrote:
On Wed, Mar 17, 2021 at 09:57:45AM +0100, Ruben Vestergaard wrote:
Hi list,
Is there a general way of injecting an environment variable into an rc
managed service? I need Smokeping to pick up the HTTPS_CA_FILE variable, but
there seems to be no obvious way to set it.
I guess I could modify the system scripts, but is there a cleaner, obvious
way I have missed?
Sure, you can create a login class that matches the rc.d script name and add the
env var in it.
e.g. login.conf entry
smokeping:\
:setenv=HTTPS_CA_FILE=foo:\
:tc=daemon:
Brilliant, just what I was looking for! Thanks!
FYI you have an example in the smokeping package README.
So there is indeed. *redface.wav*
Cheers,
-R
--
Antoine