I use EnvironmentFile
:
[root@matterhost ~]# cat /usr/lib/systemd/system/mattermost.service
[Unit]
Description=Mattermost
After=syslog.target network.target postgresql-9.4.service
[Service]
Type=simple
WorkingDirectory=/opt/mattermost/bin
User=mattermost
EnvironmentFile=/opt/mattermost/config/mm.environment
ExecStart=/opt/mattermost/bin/platform
PIDFile=/var/spool/mattermost/pid/master.pid
LimitNOFILE=49152
[Install]
WantedBy=multi-user.target
[root@matterhost ~]# cat /opt/mattermost/config/mm.environment
HTTP_PROXY=http://mm:password@192.168.1.2:3128
HTTPS_PROXY=http://mm:password@192.168.1.2:3128
make sure you tell systemd to reload before restarting your MM service: systemctl daemon-reload
-R