当前位置:网站首页>Following the previous SYSTEMd pit

Following the previous SYSTEMd pit

2022-06-24 16:57:00 Maochenchen

stay systemd After setting the startup script , The script can run normally , What I'm running is uwsgi+django, However, it is unfortunate to find that a certain software cannot be used normally during operation , Directly in command line start-up uwsgi There is no problem with the service , So it is suspected that it is the problem of environmental variables .

stay systemd Of service Add... To the file PATH

[Service]
Environment="PATH=/usr/local/texlive/2019/bin/x86_64-linux:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"

Um. , You can see that the software I can't call normally is texlive...

What we need to pay attention to here is PATH You need to write the complete address , If you add Environment="PATH=/usr/local/texlive/2019/bin/x86_64-linux:$PATH" I can't recognize it ,systemd Not recognized $PATH What is it? , If you can, you don't need to add this line ...

Then reload systemd To configure , Restart the service again ok 了

sudo systemctl daemon-reload
sudo systemctl restart test.service
原网站

版权声明
本文为[Maochenchen]所创,转载请带上原文链接,感谢
https://yzsam.com/2021/04/20210402174242773s.html

随机推荐