发掘odoo.cli.server.Server的秘密,OpenERP的第三根线头儿
command.py调用了server command
在server.py中,主函数main使用了外层模块传递来的args
def main(args):
check_root_user()
odoo.tools.config.parse_config(args)
check_postgres_user()
report_configuration() config = odoo.tools.config # the default limit for CSV fields in the module is 128KiB, which is not
# quite sufficient to import images to store in attachment. 500MiB is a
# bit overkill, but better safe than sorry I guess
csv.field_size_limit(500 * 1024 * 1024) preload = []
if config['db_name']:
preload = config['db_name'].split(',')
for db_name in preload:
try:
odoo.service.db._create_empty_database(db_name)
except odoo.service.db.DatabaseExists:
pass if config["translate_out"]:
export_translation()
sys.exit(0) if config["translate_in"]:
import_translation()
sys.exit(0) # This needs to be done now to ensure the use of the multiprocessing
# signaling mecanism for registries loaded with -d
if config['workers']:
odoo.multi_process = True stop = config["stop_after_init"] setup_pid_file()
rc = odoo.service.server.start(preload=preload, stop=stop)
sys.exit(rc)
其中line 2 check_root_user仅针对posix系统 暂时忽略
def check_root_user():
"""Warn if the process's user is 'root' (on POSIX system)."""
if os.name == 'posix':
import pwd
if pwd.getpwuid(os.getuid())[0] == 'root':
sys.stderr.write("Running as user 'root' is a security risk.\n")
经过一些检查以后 line 39 调用了odoo.service.server.start()
此函数启动了server,至此,server启动路径已经完成
发掘odoo.cli.server.Server的秘密,OpenERP的第三根线头儿的更多相关文章
- ODOO从哪里开始??OpenERP的第一根线头儿
Windows下ODOO源码启动: python odoo-bin -w odoo -r odoo --addons-path=addons,../mymodules --db-filter=mydb ...
- odoo.cli.main()指的是哪里?OpenERP的第二根线头儿
接上回,odoo-bin中调用了odoo.cli.main(),去哪儿找? cli目录容易找 跟随__init__.py的脚步 import logging import sys import os ...
- 发现SQL Server惊天大秘密!!
原文:发现SQL Server惊天大秘密!! --set statistics xml onCREATE TABLE T_TEST(ID INT IDENTITY PRIMARY KEY,Create ...
- odoo.cli.main()做了什么?
先把代码贴过来 def main(): args = sys.argv[1:] # The only shared option is '--addons-path=' needed to disco ...
- 【LR11】Error -27796: Failed to connect to server"server:port": [10060] Connection timed out错误解决办法
场景描述:被测系统是发布在远程服务器上的,假设IP是10.10.10.10,端口是8066,那么访问地址是http://10.10.10.10:8066/,在control机器上我设置了IP欺骗. ...
- mongodb 使用mongodump备份 指定用户名密码 出现错误 Failed: error connecting to db server: server returned error on SASL authentication step: Authentication failed
mongodb 使用mongodump备份 指定用户名密码 出现错误 [root@MongoDB ~]# mongodump --host -u admin -p -d db1 -o /root/ F ...
- sql server server 2005任务导入导出功能选项没有的解决方法
出现这个问题主要原因是安装的sql server是Express版本的,或者已经安装了Express版本之后安装了企业版的.但是SQL图形管理工具仍然是SQL Server Manageme ...
- 报错:org.apache.ibatis.type.TypeException: Could not resolve type alias 'com.deppon.gis.module.job.server.server.impl.HaoDuanEntity'.
- Odoo8出现Internal Server Error的解决办法之一
转载地址:http://blog.sina.com.cn/s/blog_7cb52fa80102vaf3.html 问题: 不知怎么回事,我的Odoo8出错了,重装也一样出错信息如下 Inte ...
随机推荐
- 运维神器Chef简单介绍和安装笔记
首先大概解释一下Chef Chef有三个重要的概念:(如上图所示) 它们的合作关系大致是这样的, Workstation把资源或者说是一些要被运行的命令上传到Chef-Server上, Nodes自动 ...
- JQuery中对各种域进行隐藏和显示操作
操作的基本步骤: (1)导入jquery相关jar <script type="text/javascript" src="jquery-1.1.3.pack.js ...
- 如何管理linux开机自启服务
如何管理linux开机自启服务? 自启动服务非常重要,例如 (1)需要手动添加希望自启的服务,如安装svn后没有自动添加,就需要我们手动加入(2)安装某些程序后,自动加到自启动了,但我们不需要,需要手 ...
- 转json using指令
using Newtonsoft.Json;using Newtonsoft.Json.Converters; string result = JsonConvert.SerializeObject( ...
- 【html5】常见标签使用说明(持续更新)
说明: 所谓常见,是指我在优秀网页源码中见到的. 1.viewport 我见到的时候是这样: <meta name="viewport" content="widt ...
- mac xcworkspace xcodebuild
xcodebuild 在介绍xcodebuild之前,需要先弄清楚一些在XCode环境下的一些概念[4]: Workspace:简单来说,Workspace就是一个容器,在该容器中可以存放多个你创建的 ...
- user-select : 保护版权内容的简单方案
有的适合我们需要保护我们页面的内容,为了版权或者安全等原因,这个适合我们可以使用 user-select 这个CSS属性,简单易用. 嗯,这个属性不麻烦,而且也不是 CSS 3 / CSS 4 的新属 ...
- WCF初探-4:WCF消息交换模式之请求与答复模式
请求与答复模式( Request/Reply) 这种交换模式是使用最多的一中,它有如下特征: 调用服务方法后需要等待服务的消息返回,即便该方法返回 void 类型 相比Duplex来讲,这种模式强调的 ...
- OC语言@property @synthesize和id
OC语言@property @synthesize和id 一.@property @synthesize关键字 注意:这两个关键字是编译器特性,让xcode可以自动生成getter和setter的声明 ...
- File缓存
/** * 保存对象 * @param ser * @param file * @throws IOException */ public b ...