Centos 6で基本的なフラスコアプリケーションをセットアップしました。すべてが1つのファイル(app.py)に含まれています。私は、uwsgi --ini myuwsgi.ini
というコマンドでフォルダディレクトリからuwsgiでファイルを実行することができます。 iniファイルの内容は以下のとおりです。サービスとして実行するとUwsgiはアプリケーションをロードしません
[uwsgi]
http-socket = :9090
plugin = python
wsgi-file = /project/app.py
process = 3
callable = app
私は毎回、サーバは、それが自分自身で出てくることをシャットダウンまたは何でこれを設定したいが。 service uwsgi start
コマンドを実行しようとすると、ログにはアプリケーションが見つからなかったことが示されます。サービスが使用するiniファイルは/etc/uwsgi.ini
で、これをiniファイルに置き換えました。
それが助け場合、以下のようにログのダンプは次のとおりです。
*** Starting uWSGI 2.0.13.1 (64bit) on [Fri Sep 2 07:49:37 2016] ***
compiled with version: 4.4.7 20120313 (Red Hat 4.4.7-17) on 02 August 2016 21:07:31
os: Linux-2.6.32-042stab113.21 #1 SMP Wed Mar 23 11:05:25 MSK 2016
nodename: uwsgiHost
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 2
current working directory:/
detected binary path: /usr/sbin/uwsgi
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
*** WARNING: you are running uWSGI without its master process manager ***
your processes number limit is 14605
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to TCP address :9090 fd 3
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 72768 bytes (71 KB) for 1 cores
*** Operational MODE: single process ***
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (and the only) (pid: 1315, cores: 1)
-- unavailable modifier requested: 0 --
私はiniファイル内の位置と呼び出し可能に指定されたとき、それはアプリを見つける傾けるなぜ誰も私を伝えることができれば?
を、私はまた、コメントを追加しました:10000 = uidとgid = 10000けどダメ。どのようにUID値を設定しますか?同じエラーが発生しました。 – johnfk3
上記の編集結果をご覧ください。 – ettanany
問題が修正されました。ありがとうございました! – johnfk3