编写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