How can I set environment variables in my Linux service for Asterisk even though it doesn't have a real user?

前端 未结 2 1029
一生所求
一生所求 2021-01-01 19:20

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.

2条回答
  •  时光说笑
    2021-01-01 19:44

    If your distro of choice is now using systemd try systemctl edit --full asterisk.service and consider EnvironmentFile and Environment

    These files normally live here: /etc/systemd/system/myservice.service e.g cron.service

提交回复
热议问题