編寫uwsgi后台啟動文件


1. 打開一個文件hello.service

vim /etc/systemd/system/hello.service

2. 

[Unit]
Description=uWSGI instance to serve file-redis-load
After=network.target

[Service]
User=root
Group = nginx
WorkingDirectory=/var/www/demoapp
Environment="PATH=/usr/local/python3/bin"
ExecStart=/usr/bin/uwsgi --ini demoapp_uwsgi.ini

[Install]
WantedBy=multi-user.target

3. 啟動

systemctl daemon-reload
systemctl start hello.service
systemctl stop hello.servcie
systemctl restart hello.service

 

systemctl enable hello.service  開機啟動
systemctl disable hello.service

 

systemctl is-enabled hello.service 查看開機是否啟動

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM