主机是腾讯云之前活动上的成都的车,1 核 1G,严格按照 https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-uwsgi-and-nginx-on-ubuntu-16-04 部署 (跟这篇帖子差不多: https://www.v2ex.com/t/386228 ),能正常使用。想查看 uwsgi 日志,在 uwsgi.ini 加上 daemonize 参数打日志到本地后,每次启动后 20 秒内 uwsgi 服务就会奔溃,情况跟 do 下面的跟帖差不多。求教大佬这是哪方面引起的问题。计算机爱好者,希望能通俗点,谢谢!
1
BOYPT 2018-11-18 16:54:21 +08:00
崩溃日志说了啥起码贴一下吧
|
2
yezhiye OP @BOYPT 加上去后果然又崩溃了:
● myweb.service - uWSGI instance to serve myweb Loaded: loaded (/etc/systemd/system/myweb.service; enabled; vendor preset: enabled) Active: failed (Result: timeout) since Sun 2018-11-18 17:19:21 CST; 38s ago Process: 13014 ExecStart=/home/ubuntu/myweb/mywebenv/bin/uwsgi --ini /home/ubuntu/myweb/myweb.ini (code=exited, status=0/SUCCE Main PID: 13014 (code=exited, status=0/SUCCESS) Nov 18 17:18:51 VM-0-5-ubuntu systemd[1]: Stopped uWSGI instance to serve myweb. Nov 18 17:18:51 VM-0-5-ubuntu systemd[1]: Started uWSGI instance to serve myweb. Nov 18 17:18:51 VM-0-5-ubuntu uwsgi[13014]: [uWSGI] getting INI configuration from /home/ubuntu/myweb/myweb.ini Nov 18 17:19:21 VM-0-5-ubuntu systemd[1]: myweb.service: State 'stop-sigterm' timed out. Killing. Nov 18 17:19:21 VM-0-5-ubuntu systemd[1]: myweb.service: Unit entered failed state. Nov 18 17:19:21 VM-0-5-ubuntu systemd[1]: myweb.service: Failed with result 'timeout'. |
4
BOYPT 2018-11-18 17:34:44 +08:00 1
日志写得很清楚啊,是 systemd unit timeout 强制 kill 掉的,不是崩溃的。你应该好好看看你的 service 文件都写了啥
|
5
wwqgtxx 2018-11-18 19:22:28 +08:00 via iPhone 1
把 systemd 的 service 文件中 type 从 simple 改成 fork
|