I have created a linux service that runs as a deamon (and gets started from /etc/init.d/X). I need to set some environment variables that can be accessed by the application.
If your distro of choice is now using systemd try systemctl edit --full asterisk.service and consider EnvironmentFile and Environment
systemctl edit --full asterisk.service
EnvironmentFile
Environment
These files normally live here: /etc/systemd/system/myservice.service e.g cron.service
/etc/systemd/system/myservice.service
cron.service