Skip to content
  • Categories
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse

Odoo 中文社区

  1. Home
  2. Categories
  3. Odoo 安装指南
  4. Tingerp 不支持 python 2.5 吗?

Tingerp 不支持 python 2.5 吗?

Scheduled Pinned Locked Moved Odoo 安装指南
21 Posts 4 Posters 25.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • digitalsatoriD Offline
    digitalsatoriD Offline
    digitalsatori 管理员
    wrote on last edited by
    #8

    服务器运行完全正常。你用的是什么Linux.
    用127.0.0.1连接试试
    看一下/etc/hosts的内容是否有:
    [quote]127.0.0.1 localhost.localdomain localhost [/quote]

    【上海先安科技】(tony AT openerp.cn)

    1 Reply Last reply
    0
    • W Offline
      W Offline
      wwguo
      wrote on last edited by
      #9

      我用的是 gentoo。

      /etc/hosts 里有那一行,这个设置应该没啥问题,apache用localhost时没问题。

      1 Reply Last reply
      0
      • digitalsatoriD Offline
        digitalsatoriD Offline
        digitalsatori 管理员
        wrote on last edited by
        #10

        db_password和db_user未定义。
        很奇怪你的server log为什么没有显示无法连接数据库。
        请手动修改你的.terp_serverrc 或使用下面的命令启动服务器:

        python tinyerp-server.py --db_user=xxx --db_password=xxx -s
        

        【上海先安科技】(tony AT openerp.cn)

        1 Reply Last reply
        0
        • W Offline
          W Offline
          wwguo
          wrote on last edited by
          #11

          我把 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]]

          1 Reply Last reply
          0
          • digitalsatoriD Offline
            digitalsatoriD Offline
            digitalsatori 管理员
            wrote on last edited by
            #12

            PGSQL在linux上默认使用的是same user ident, 就是当系统用户与数据库用户同名时即可访问。当你用start-stop-daemon启动tiny server时指定了系统用户为terp,而你所在PGSQL的帐套数据库也是以terp用户创建的,所以数据库访问没有问题。当你直接运行tinyerp-server时,可能你当时的登录用户名非terp.

            Tiny ERP有一些运行参数,可以通过输入以下命令了解:

            tinyerp-server --help
            

            其中 -s参数用以将命令参数保存到.terp_serverrc文件中,这样以后就不需要每次都运行这些参数了。

            密码以明文保存的确有安全隐患,这个问题已有人提出,并且可能已有解决方案。

            【上海先安科技】(tony AT openerp.cn)

            1 Reply Last reply
            0
            • W Offline
              W Offline
              wwguo
              wrote on last edited by
              #13

              还有一点不明白,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]]

              1 Reply Last reply
              0
              • W Offline
                W Offline
                wwguo
                wrote on last edited by
                #14

                再补充一个,不晓得是不是 tinyerp 的 bug。还是前面提到的 pid 不能停的问题。刚才检查,其实 pid 是被停了,/var/run/tinyerp 中的 pid 文件确实没了,但是 8069 端口却被占着没有释放。

                1 Reply Last reply
                0
                • ? Offline
                  ? Offline
                  Guest
                  wrote on last edited by
                  #15

                  在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不能释放端口的问题还没研究过,希望你能找到结果与我们分享。

                  1 Reply Last reply
                  0
                  • W Offline
                    W Offline
                    wwguo
                    wrote on last edited by
                    #16

                    不好意思,再接着问个与TinyERP无关的问题。我在 pg_hba.conf 设置了 localhost MD5 后,再用下面命令创建数据库时总是提示密码错误,是不是就是因为我没有在 PG 中创建 postgres 这个帐号?

                    createdb -U postgres test
                    

                    pid 的问题我怀疑是 TinyERP 做的有些菜的缘故。TinyERP wiki 上就是建议用 kill -2 pid 来停 server 的。实在是有点……

                    [[i] 本帖最后由 wwguo 于 2008-5-19 23:32 编辑 [/i]]

                    1 Reply Last reply
                    0
                    • digitalsatoriD Offline
                      digitalsatoriD Offline
                      digitalsatori 管理员
                      wrote on last edited by
                      #17

                      www.chinaunix.net/jh/18/8176.html 有一篇关于PGSQL客户端访问认证较全面的文章,楼主可以研究一下。
                      [quote]TinyERP wiki 上就是建议用 kill -2 pid 来停 server 的。实在是有点……[/quote]
                      看得出楼主对Linux的Shell命令很了解,能否写篇文章为我们解释一下kill命令的用法,谢谢了。

                      【上海先安科技】(tony AT openerp.cn)

                      1 Reply Last reply
                      0
                      • W Offline
                        W Offline
                        wwguo
                        wrote on last edited by
                        #18

                        惭愧,被误认为是高手了。我那句话的意思是 server 居然要用 kill 来停,而不是用 start-stop-daemon 停,让人觉得 Tiny server 是个仓促上马的作品。

                        关于 kill,我只晓得 kill 10344 这一种用法。那个 -2 参数是 Tiny wiki 上说的。kill 命令很复杂吗?

                        [[i] 本帖最后由 wwguo 于 2008-5-20 10:27 编辑 [/i]]

                        1 Reply Last reply
                        0
                        • digitalsatoriD Offline
                          digitalsatoriD Offline
                          digitalsatori 管理员
                          wrote on last edited by
                          #19

                          其实start-stop-daemon应该只是个脚本程序。kill是linux系统中用于系统调度的命令。start-stop-daemon最终停止一个进程也是要用到kill的。如果在debian系统下据说有个update-rc.d, 也不错。

                          kill算不上复杂,但是掌握了以后非常有用,在编程中也经常会用到kill.

                          [[i] 本帖最后由 digitalsatori 于 2008-5-20 21:01 编辑 [/i]]

                          【上海先安科技】(tony AT openerp.cn)

                          1 Reply Last reply
                          0
                          • A Offline
                            A Offline
                            ajax79
                            wrote on last edited by
                            #20

                            ds,wiki里的linux相关是你写的?

                            端得一手好文笔啊

                            1 Reply Last reply
                            0
                            • digitalsatoriD Offline
                              digitalsatoriD Offline
                              digitalsatori 管理员
                              wrote on last edited by
                              #21

                              多谢ajax79的夸奖。很不好意思,信誓旦旦“每日一讲”,结果写了四篇就又兴趣他投了。
                              有时间还是继续练笔,也好巩固所学。

                              【上海先安科技】(tony AT openerp.cn)

                              1 Reply Last reply
                              0

                              • Login

                              • Don't have an account? Register

                              • Login or register to search.
                              • First post
                                Last post
                              0
                              • Categories
                              • Tags
                              • Popular
                              • Users
                              • Groups