综述: moin的启动由supervisord改成了/etc/init.d/uwsgi,应该不会有什么问题了。
细节: service uwsgi start后会加载/etc/uwsgi/apps-enabled/moin.xml 来启动moin。日志在 /var/log/uwsgi/app/moin.log。 测试时出现错误service uwsgi start后提示fail,但是uwsgi进程出现,wiki能正常使用。 经@heroxbd学长检查后发现,是lxc关闭了 sys_ptrace 功能。加入此功能,service uwsgi restart,工作正常。 > ~$ sudo supervisorctl status moin > moin FATAL Exited too quickly > (process log may have details) > > 不过现在 wiki.tuna.tsinghua.edu.cn 确实是可以访问的,为啥……是我的疏忽,uwsgi加了参数-d > ,以daemon模式后台启动了,stay up 没有达到 supervisor 默认的startsecs(1s)。supervisord > 判定它启动失败,而反复重启,达到3次后放弃。(此时自动忽略exitcodes的设置) > 另外,现在 moin 是用 root 跑的么……uwsgi现在工作在www-data身份下。 唐如麟 清华大学物理系 基科22 ---------------------- Tang Rulin Department of Physics Tsinghua University E-mail: f (mailto:[email protected])[email protected] (mailto:[email protected]) [email protected] (mailto:[email protected]) On Thursday, February 27, 2014 at 12:00 AM, Cheer Xiao wrote: > 在 2014年2月26日 下午8:39,唐如麟 <[email protected] (mailto:[email protected])> > 写道: > > 综述: > > > > 这次wiki停止工作是由于/usr/bin/uwsgi的软链被修改,指向了另外一个版本引起的,可能是软件升级原因,现已修好,并采取措施避免下次发生。 > > > > 细节: > > > > moin的位置在/srv/moin 其中有指向 /usr/local/lib/python2.6/dist-packages/MoinMoin 的软链 > > > > moin由supervisord启动 脚本在/etc/supervisor/conf.d/moin.conf > > > > wiki搬迁过程中,源里的uwsgi一直不好用,当时怀疑版本过低,我就自己编译了一个版本uwsgi-1.9.21.1,放在了/etc/alternatives/,并把/usr/bin/uwsgi指向了它。 > > > > 今天早上看到出了问题,发现/usr/bin/uwsgi指向/etc/alternatives/uwsgi-1.9.21.1的软链被指向了/etc/alternatives/uwsgi(版本1.2.3)。修改回去以后,恢复正常。 > > > > 为了避免以后此类情况发生,下午,从sid安装了1.9.17.1,/usr/bin/uwsgi指向/etc/alternatives/uwsgi。 > > > > 再次启动出错,查看日志: > > > > File "/usr/local/lib/python2.6/dist-packages/MoinMoin/Page.py", line 1318, > > in execute > > exec code > > File "Homepage", line 2, in <module> > > TypeError: 'dict' object is not callable > > [pid: 19101|app: 0|req: 3/3] 2402:f000:9:7c01:1::801 () {38 vars in 650 > > bytes} [Wed Feb 26 09:55:53 2014] GET / => generated 0 bytes in 47 msecs > > (HTTP/1.1 500) 0 headers in 0 bytes (0 switches on core 0) > > > > google说是由于python版本升级引起的(貌似之前运行在2.6下),需要清理moin的cache: > > > > root@web:/srv/moin/package/script# ./moin.py --config-dir=/srv/moin maint > > cleancache > > > > 重启相关服务后恢复正常。 > ~$ sudo supervisorctl status moin > moin FATAL Exited too quickly > (process log may have details) > > 不过现在 wiki.tuna.tsinghua.edu.cn 确实是可以访问的,为啥…… > > 另外,现在 moin 是用 root 跑的么…… > > > 另外,pip install uwsgi可安装2.0.1,且启动不需要使用—plugin python参数 > > > > 感谢@heroxbd 学长的指导。 > > > > > > > > 唐如麟 > > 清华大学物理系 > > 基科22 > > ---------------------- > > Tang Rulin > > Department of Physics > > Tsinghua University > > E-mail: [email protected] (mailto:[email protected]) > > [email protected] (mailto:[email protected]) > > > > -- > > > > --- > > 您收到此邮件是因为您订阅了 Google 网上论坛的“TUNA 主邮件列表”论坛。 > > 要退订此论坛并停止接收此论坛的电子邮件,请发送电子邮件到 [email protected] > > (mailto:[email protected])。 > > 要查看更多选项,请访问 https://groups.google.com/groups/opt_out。 > > > -- > Best regards, > 肖骐 Cheer Xiao > > -- > > --- > 您收到此邮件是因为您订阅了 Google 网上论坛的“TUNA 主邮件列表”论坛。 > 要退订此论坛并停止接收此论坛的电子邮件,请发送电子邮件到 [email protected] > (mailto:[email protected])。 > 要查看更多选项,请访问 https://groups.google.com/groups/opt_out。 -- --- 您收到此邮件是因为您订阅了 Google 网上论坛的“TUNA 主邮件列表”论坛。 要退订此论坛并停止接收此论坛的电子邮件,请发送电子邮件到 [email protected]。 要查看更多选项,请访问 https://groups.google.com/groups/opt_out。
