修改 systemd service 的环境变量

修改 systemd service 的环境变量,可以通过 sudo systemctl status <service_name> 来找到 service file path.

然后修改环境变量:

[Service]
Environment=PATH=:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:

reload config 和重启 service

sudo systemctl daemon-reload 
sudo systemctl restart 

Leave a Reply