Tingerp 不支持 python 2.5 吗?
-
可以启动,从log信息看似乎一切正常,但是 client 显示不能连接server。下面是log信息:[code]Fri, 16 May 2008 13:28:26 INFObjects:initialising distributed objects services
Fri, 16 May 2008 13:28:26 INFO:init:connecting to database
Fri, 16 May 2008 13:28:27 INFO:init:addon:base:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:network:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:marketing:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:base_partner_relation:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:custom:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:productivity_analysis:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:hr:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:subscription:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:base_setup:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:product:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:letter:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:account:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:sandwich:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:l10n_chart_sw_church:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:l10n_chart_no:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:l10n_chart_nl:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:l10n_chart_us_service:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:l10n_chart_ca_en:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:l10n_chart_us_manufacturing:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:l10n_chart_da:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:l10n_chart_pl:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:account_tax_include:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:l10n_chart_pa:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:l10n_fr:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:l10n_chart_ch_german:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:crm:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:l10n_ca-qc:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:l10n_chart_uk:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:l10n_chart_sw_food:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:l10n_chart_nl_standard:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:l10n_simple:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:l10n_chart_ve:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:l10n_chart_us_ucoa_ez:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:l10n_chart_us_general:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:l10n_chart_ca_fr:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:l10n_chart_it_cc2424:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:l10n_chart_br:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:l10n_chart_sw:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:l10n_chart_sp:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:l10n_ch:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:hr_timesheet:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:l10n_chart_cz:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:l10n_chart_cn_traditional:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:l10n_chart_co:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:l10n_chart_cn:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:hr_expense:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:l10n_be:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:l10n_chart_de_skr03:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:account_followup:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:l10n_chart_hu:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:l10n_chart_us_ucoa:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:l10n_chart_la:registering classes
Fri, 16 May 2008 13:28:27 INFO:init:addon:stock:registering classes
Fri, 16 May 2008 13:28:28 INFO:init:addon:l10n_chart_au:registering classes
Fri, 16 May 2008 13:28:28 INFO:init:addon:l10n_chart_at:registering classes
Fri, 16 May 2008 13:28:28 INFO:init:addon:l10n_chart_id:registering classes
Fri, 16 May 2008 13:28:28 INFO:init:addon:l10n_chart_it:registering classes
Fri, 16 May 2008 13:28:28 INFO:init:addon:l10n_chart_be_frnl:registering classes
Fri, 16 May 2008 13:28:28 INFO:init:addon:l10n_ch_pcpbl_plangensimpl:registering classes
Fri, 16 May 2008 13:28:28 INFO:init:addon:product_electronic:registering classes
Fri, 16 May 2008 13:28:28 INFO:init:addon:purchase:registering classes
Fri, 16 May 2008 13:28:28 INFO:init:addon:l10n_ch_pcpbl_independant:registering classes
Fri, 16 May 2008 13:28:28 INFO:init:addon:hr_timesheet_invoice:registering classes
Fri, 16 May 2008 13:28:28 INFO:init:addon:l10n_ch_pcpbl_menage:registering classes
Fri, 16 May 2008 13:28:28 INFO:init:addon:l10n_ch_vat_net:registering classes
Fri, 16 May 2008 13:28:28 INFO:init:addon:product_expiry:registering classes
Fri, 16 May 2008 13:28:28 INFO:init:addon:l10n_ch_pcpbl_plangen:registering classes
Fri, 16 May 2008 13:28:28 INFO:init:addon:l10n_ch_vat_forfait:registering classes
Fri, 16 May 2008 13:28:28 INFO:init:addon:l10n_ch_vat_brut:registering classes
Fri, 16 May 2008 13:28:28 INFO:init:addon:hr_timesheet_ical:registering classes
Fri, 16 May 2008 13:28:28 INFO:init:addon:l10n_ch_pcpbl_association:registering classes
Fri, 16 May 2008 13:28:28 INFO:init:addon:report_crm:registering classes
Fri, 16 May 2008 13:28:28 INFO:init:addon:purchase_tax_include:registering classes
Fri, 16 May 2008 13:28:28 INFO:init:addon:report_analytic_line:registering classes
Fri, 16 May 2008 13:28:28 INFO:init:addon:report_purchase:registering classes
Fri, 16 May 2008 13:28:28 INFO:init:addon:mrp:registering classes
Fri, 16 May 2008 13:28:28 INFO:init:addon:profile_accounting:registering classes
Fri, 16 May 2008 13:28:28 INFO:init:addon:sale:registering classes
Fri, 16 May 2008 13:28:28 INFO:init:addon:product_extended:registering classes
Fri, 16 May 2008 13:28:28 INFO:init:addon:esale_joomla:registering classes
Fri, 16 May 2008 13:28:28 INFO:init:addon:report_sale:registering classes
Fri, 16 May 2008 13:28:28 INFO:init:addon:sale_tax_include:registering classes
Fri, 16 May 2008 13:28:28 INFO:init:addon:edi:registering classes
Fri, 16 May 2008 13:28:28 INFO:init:addon:sale_crm:registering classes
Fri, 16 May 2008 13:28:28 INFO:init:addon:esale_osc:registering classes
Fri, 16 May 2008 13:28:28 INFO:init:addon:sale_journal:registering classes
Fri, 16 May 2008 13:28:28 INFO:init:addon:delivery:registering classes
Fri, 16 May 2008 13:28:28 INFO:init:addon:project:registering classes
Fri, 16 May 2008 13:28:28 INFO:init:addon:hr_timesheet_project:registering classes
Fri, 16 May 2008 13:28:28 INFO:init:addon:profile_manufacturing:registering classes
Fri, 16 May 2008 13:28:28 INFO:init:addon:report_project:registering classes
Fri, 16 May 2008 13:28:28 INFO:init:addon:scrum:registering classes
Fri, 16 May 2008 13:28:28 INFO:init:addon:profile_service:registering classes
Fri, 16 May 2008 13:28:28 INFO:web-services:starting XML-RPC services, port 8069
Fri, 16 May 2008 13:28:28 INFO:web-services:You are not using the SSL layer
Fri, 16 May 2008 13:28:28 INFO:web-services:the server is running, waiting for connections...[/code][[i] 本帖最后由 wwguo 于 2008-5-16 13:25 编辑 [/i]]
-
服务器运行完全正常。你用的是什么Linux.
用127.0.0.1连接试试
看一下/etc/hosts的内容是否有:
[quote]127.0.0.1 localhost.localdomain localhost [/quote] -
db_password和db_user未定义。
很奇怪你的server log为什么没有显示无法连接数据库。
请手动修改你的.terp_serverrc 或使用下面的命令启动服务器:python tinyerp-server.py --db_user=xxx --db_password=xxx -s
-
我把 TinyERP server 重头安装了一遍,现在我用
start-stop-daemon --start --quiet --background --user terp:terp --pidfile=/var/run/tinyerp/tinyerp.pid --startas /usr/bin/tinyerp-server
就可以顺利启动 tinyerp-server 了。但是用
tinyerp-server
就会显示无法连接数据库。我估计是因为我没有 .terp_server 文件。我现在只用一个配置文件:[code]SERVER_DB=terp
SERVER_USER=${SERVER_DB}------------------------------------------------------
If you run the database on localhost and
have trust set in your pg_hba.conf (the default),
you do not need to change anything below.
------------------------------------------------------
#SERVER_PW=
#SERVER_HOST=
#SERVER_PORT=
#SERVER_OPTS=""[/code]有个问题让我很好奇,我用 netstat 查看 8069 端口显示:tcp 0 0 0.0.0.0:8069 0.0.0.0:* LISTEN 10920/python
不明白为什么是 0.0.0.0,而不是 localhost?而且这个pid 经常出现不能停止的情况。
另外顺便问个帐号的问题。以我的系统为例,TinyERP 涉及 4 类帐号:
[list type=decimal]
[li]Linux 系统帐号:terp:terp 和 wwguo:users[/li][li]PostgreSQL 帐号:terp 和 wwguo[/li][li]TinyERP 管理员帐号:admin[/li][li]TinyERP 用户帐号:demo[/li][/list]
我的问题是上面的帐号之间有什么关系?比如我在 wwguo 的 home 下运行 tinyerp-client,那么我现在用的postgresql 帐号是那个?terp吗?这个 terp 和 admin 有什么关系呢?demo 呢?我能不能创建 TinyERP 的wwguo 帐号呢?这个 wwguo 帐号和我系统的 wwguo 又是什么关系呢?我能不能用我PostgreSQL 中的 wwguo 帐号呢?……总之觉得很乱。另外抱怨一下,TinyERP 的密码居然都是明文保存的,安全性……
[[i] 本帖最后由 wwguo 于 2008-5-17 13:08 编辑 [/i]]
-
PGSQL在linux上默认使用的是same user ident, 就是当系统用户与数据库用户同名时即可访问。当你用start-stop-daemon启动tiny server时指定了系统用户为terp,而你所在PGSQL的帐套数据库也是以terp用户创建的,所以数据库访问没有问题。当你直接运行tinyerp-server时,可能你当时的登录用户名非terp.
Tiny ERP有一些运行参数,可以通过输入以下命令了解:
tinyerp-server --help
其中 -s参数用以将命令参数保存到.terp_serverrc文件中,这样以后就不需要每次都运行这些参数了。
密码以明文保存的确有安全隐患,这个问题已有人提出,并且可能已有解决方案。
-
还有一点不明白,admin 帐号对应的是不是就是 postgres 的 terp 帐号?
另外,创建新“帐套”时出错,下面是 log 信息:
[code]Mon, 19 May 2008 00:30:27 ERROR:web-services:Exception in call: Traceback (most recent call last):
File "/usr/lib/python2.5/site-packages/tinyerp-server/netsvc.py", line 200, in _dispatch
r=m(*params)
File "/usr/lib/python2.5/site-packages/tinyerp-server/service/web_services.py", line 126, in create
raise Exception, "Couldn't create database"
Exception: Couldn't create database[/code]ps. 为什么用“帐套”这个词,是ERP软件的标准用法吗?
[[i] 本帖最后由 wwguo 于 2008-5-19 00:28 编辑 [/i]]
-
在Tiny中帐套就是一个数据库。看来你把几个“用户”搞混淆了。
Linux的系统用户
PG数据库用户(Role)
Tiny系统使用用户
首先Tiny系统使用用户与其他两个用户没有直接关系。在创建Tiny帐套后Tiny会默认给出两个基本用户Admin和demo
Linux系统用户和PG数据库用户也可以没有直接的关系,但是PG在Linux上默认使用了same-user ident的数据库访问权限设置,(PG数据库的访问方式在数据库data目录下的pg_hba.conf中设置。)所以当Linux系统用户名和数据库用户名(Role)相同时可以访问数据库。至于kill Pid不能释放端口的问题还没研究过,希望你能找到结果与我们分享。
-
www.chinaunix.net/jh/18/8176.html 有一篇关于PGSQL客户端访问认证较全面的文章,楼主可以研究一下。
[quote]TinyERP wiki 上就是建议用 kill -2 pid 来停 server 的。实在是有点……[/quote]
看得出楼主对Linux的Shell命令很了解,能否写篇文章为我们解释一下kill命令的用法,谢谢了。 -
其实start-stop-daemon应该只是个脚本程序。kill是linux系统中用于系统调度的命令。start-stop-daemon最终停止一个进程也是要用到kill的。如果在debian系统下据说有个update-rc.d, 也不错。
kill算不上复杂,但是掌握了以后非常有用,在编程中也经常会用到kill.
[[i] 本帖最后由 digitalsatori 于 2008-5-20 21:01 编辑 [/i]]
-
多谢ajax79的夸奖。很不好意思,信誓旦旦“每日一讲”,结果写了四篇就又兴趣他投了。
有时间还是继续练笔,也好巩固所学。