Sympa + PostgreSQL安装:Upgrade :: probe_db()表user_table not found(Ubuntu Hardy)

尝试在Ubuntu Hardy服务器上安装Sympa时遇到了问题。

这个问题似乎与相关的PostreSQL数据库有关。

我遵循的步骤是:

1)安装PostreSQL。

sudo apt-get install postgresql postgresql-client postgresql-contrib libpq-dev 

2)更新PostgreSQL的pipe理员密码。 PostgreSQL为其“pipe理员”创build两个帐户。 一个是“数据库帐户”(用于loginpostgresql本身),另一个是“linux帐户”(用于在服务器上创build文件,我猜)。 我重置数据库帐户的密码是这样的:

 sudo su postgres -c psql ALTER USER postgres WITH PASSWORD 'password'; \q 

然后重新设置“linux帐户”密码通常的方式:

 sudo passwd -d postgres sudo su postgres -c passwd 

3)在PostgreSQL上启用密码访问。 默认情况下PostgreSQL只允许你用你的linux名字login。 因此,如果您以用户“tim”的身份login到Linux,则只能让您以“tim”的身份input数据库。 我们想改变这个,所以它要求你input用户名和密码,所以你可以作为其他人login。

 sudo nano /etc/postgresql/8.3/main/pg_hba.conf 

在那个文件上,我更新了以下几行:

 #local all all ident sameuser local all all md5 #host all all 127.0.0.1/32 ident sameuser host all all 127.0.0.1/32 md5 #host all all ::1/128 ident sameuser host all all ::1/128 md5 

4)现在是时候安装sympa。 我只是这样做了:

 sudo apt-get install sympa 

5)我被提示安装大量的perl软件包。 我接受了这些build议。

6)然后出现一个对话框,我回答了3个问题:

  • 你将使用什么types的数据库? PostgreSQL的
  • 数据库运行的主机名是什么? 本地主机
  • 什么是sympa用户密码? input密码 (两次)
  • 什么是数据库pipe理员密码? input步骤2)使用的密码

此时安装将显示以下消息:

 /etc/sympa/sympa.conf file has been created /etc/sympa/wwsympa.conf file has been created * Reloading system log daemon... [ OK ] Upgrade::probe_db() Table user_table not found in database sympa Upgrade::probe_db() Table subscriber_table not found in database sympa Upgrade::probe_db() Table admin_table not found in database sympa DBD::Pg::db do failed: ERROR: permission denied to create database Upgrade::probe_db() Failed to run script '/usr/lib/sympa/bin/create_db.Pg' : ERROR: permission denied to create database DBD::Pg::st execute failed: ERROR: relation "user_table" does not exist List::get_user_db() Unable to execute SQL statement "SELECT email_user AS email, gecos_user AS gecos, password_user AS password, cookie_delay_user AS cookie_delay, lang_user AS lang , attributes_user AS attributes FROM user_table WHERE email_user = '[email protected]' " : ERROR: relation "user_table" does not exist Language::SetLang() Language::SetLang(), missing locale parameter Database sympa defined in sympa.conf has not the right structure or is unreachable. If you don't use any database, comment db_xxx parameters in sympa.conf Sympa failed to prepare database. dpkg: error processing sympa (--configure): subprocess post-installation script returned error exit status 1 Errors were encountered while processing: sympa E: Sub-process /usr/bin/dpkg returned an error code (1) 

然而,sympa数据库和用户是在数据库上创build的 – 我看到他们,如果我这样做:

 sudo su postgres -c psql /du (list of users contains sympa) /l (list of databases contains sympa) 

看起来好像sympa安装程序不能连接到posgre,因此它不会find它需要的表…然后重新解释为“数据库缺失”的错误。

我不知道如何跟踪这个错误。 任何指针将不胜感激。

尝试不重置psql数据库用户的密码。

根据http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=440109#27 ,这解决了这个问题。

老问题,我知道,但我刚刚在Sympa 6.1.17〜dfsg-1上得到了与ubuntu 14.04相同的错误。

我发现运行脚本手动工作。

  sudo apt-get install sympa # errors happen psql -U postgres #or some superuser drop database sympa; \i /usr/lib/sympa/bin/create_db.Pg \q sudo dpkg-reconfigure sympa 

然后,在重新configuration的过程中,假设你想重新设置数据库,但是这次它会find预期的表,所以它不会再尝试运行脚本。

Sympa和PostgreSQL很好地协作(在5.3和6.1上都testing过)。 它在Upgrade.pm模块中只有一些问题,它检查表的存在,因为PostgreSQL(更确切地说,它的Perl模块)正在返回带有模式作为前缀的表名,并且因为这个表名比较失败。 我已经提交了一个补丁的错误 。

Sympa只完全支持MySQL和Sendmail(至less在Hardy版本库中是这样)。

试图安装它与其他configuration(即PosgreSQL + PostFix),你或多或less是自己的…准备修改Perl文件和(可能)在某个时候重新编译它。