http://my.oschina.net/wangbuke/blog/67431 从源码启动openerp,简单的做法是添加启动脚本到/etc/init.d/rc.local等,让openerp 随系统启动而运行。此类方法只在系统启动时运行,但万一程序在运行中崩溃,您可能要等到用户发现不能使用了,才去重启服务器。下面请出今天的主角: supervisor (http://supervisord.org/)
Supervisor 是什么?
Supervisor is a client/server system that allows its users to monitor and control a number of processes on UNIX-like operating systems. Supervisor 是一个客户端/服务器系统,允许用户监控和控制类 Unix 操作系统上的进程数。
1、安装
debian/ubuntu
1
apt-get
install
supervisor
redhat/centos
2、建立openerp 的配置文件
openerp.conf 内容
03
command
=python /var/www/openerp-6.1-1/openerp-server -c /var/www/openerp-6.1-1/openerp-server.conf
05
directory=/var/www/openerp-6.1-1/
10
; 启动时间,如果超过这个时间oe还没有挂,则视为已经启动
16
stdout_logfile=/var/www/openerp-6.1-1/openerp-server.log
17
stdout_logfile_maxbytes=500MB
18
stdout_logfile_backups=50
19
stdout_capture_maxbytes=1MB
20
stdout_events_enabled=
false
3、完成!重启系统试试看openerp 是否已经启动。也可以想办法把openerp 搞崩溃,试试supervisor 能不能及时将openerp 重启
4、常用命令
2
openerp RUNNING pid 9454, uptime 4:43:34
3
supervisor> start openerp
4
supervisor> stop openerp
5
supervisor> restart openerp
6
supervisor> status openerp