官方有個(gè)介紹在/etc/init/目錄下創(chuàng)建一個(gè)配置文件可以自動(dòng)啟動(dòng):-bash-4.1#cat/etc/init/uwsgi.confdescription"uWSGI"startonrunlevel[2345]stoponrunlevel[06]execuwsgi--emperor/etc/uwsgi/vassals但我發(fā)現(xiàn),啟動(dòng)我Python的os.environ獲取不到環(huán)境變量。但在終端手動(dòng)啟動(dòng)是可以的:-bash-4.1#uwsgi--emperor/etc/uwsgi/vassals是不是/etc/init/里面的腳本啟動(dòng)的時(shí)候還沒加載環(huán)境變量?怎么寫/etc/init.d/的啟動(dòng)uwsgi的腳本?附測(cè)試程序pythonimportosprint'user:'+str(os.environ.get('USER'))defapplication(env,start_response):start_response('200OK',[('Content-Type','text/html')])return['HelloWorld']
求一個(gè)uwsgi自動(dòng)啟動(dòng)的腳本
慕碼人8056858
2019-03-30 11:35:17