1

我根据https://www.howtoforge.com/the-perfect-database-server-firebird-2.5-and-freebsd-8.1上的说明安装了 Firebird 数据库服务器(2.5 版) ,我收到此消息“请不要将 firebird 构建为“root”,因为这可能会导致与正在运行的服务的 SysV 信号量发生冲突”

尝试以普通用户身份编译失败,因为我无权在此目录中写入。

以 root 身份安装 Firebird 后,当我尝试创建本地数据库时出现错误:

# isql-fb
Use CONNECT or CREATE DATABASE to specify a database
SQL> CREATE DATABASE '/test/my.fdb';
Bus error (core dumped)

有人能帮助我吗?

4

2 回答 2

1

最简单的方法是以root用户身份安装软件包,例如:

# pkg install firebird25-server

如果您想使用端口,请尝试以下操作:

# cd /usr/ports/databases/firebird25-server
# make install clean

无论哪种情况,您收到的消息都会是这样的(您可以忽略它继续安装,只需要等待 5 秒钟,然后它就会继续):

> pkg install firebird25-server
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
Updating poudriere repository catalogue...
poudriere repository is up to date.
All repositories are up to date.
Updating database digests format: 100%
The following 2 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        firebird25-server: 2.5.8_1 [FreeBSD]
        firebird25-client: 2.5.8_1 [FreeBSD]

Number of packages to be installed: 2

The process will require 22 MiB more space.
5 MiB to be downloaded.

Proceed with this action? [y/N]: y
[1/2] Fetching firebird25-server-2.5.8_1.txz: 100%    2 MiB   2.4MB/s    00:01
[2/2] Fetching firebird25-client-2.5.8_1.txz: 100%    3 MiB 943.7kB/s    00:03
Checking integrity... done (0 conflicting)
[1/2] Installing firebird25-client-2.5.8_1...
[1/2] Extracting firebird25-client-2.5.8_1: 100%
[2/2] Installing firebird25-server-2.5.8_1...
===> Creating groups.
Creating group 'firebird' with gid '90'.
===> Creating users
Creating user 'firebird' with uid '90'.
###############################################################################

                             ** IMPORTANT **

Keep in mind that if you build firebird server as 'root', this may cause
conflicts with SysV semaphores of running services.

If you want to cancel it, press ctrl-C now if you need check some things
before of build it.

###############################################################################

这里休眠 5秒,然后继续:

[2/2] Extracting firebird25-server-2.5.8_1: 100%
Message from firebird25-server-2.5.8_1:

###############################################################################

Firebird was installed.

1) Support for Super Server has been added

2) Before start the server ensure that the following line exists in /etc/services:

gds_db          3050/tcp  #InterBase Database Remote Protocol

3) If you use inetd (Classic Server) then add the following line to /etc/inetd.conf

gds_db  stream  tcp     nowait  firebird        /usr/local/sbin/fb_inet_server  fb_inet_server

And finally restart inetd.

4) If you want to use SuperClassic Server then you must add the following lines
   to /etc/rc.conf file.

 firebird_enable="YES"
 firebird_mode="superclassic"

5) If you want to use Super Server then you must add the following lines to
   /etc/rc.conf file.

 firebird_enable="YES"
 firebird_mode="superserver"

 Note: Keep in mind that you only can add one of them but never both modes on
       the same time

6) It is STRONGLY recommended that you change the SYSDBA
password with:

 # gsec -user SYSDBA -pass masterkey
 GSEC> modify SYSDBA -pw newpassword
 GSEC> quit

before doing anything serious with Firebird.

7) See documentation in /usr/local/share/doc/firebird/ for more information.

8) Some firebird tools were renamed for avoid conflicts with some other ports

        /usr/local/bin/isql     ->      /usr/local/bin/isql-fb
        /usr/local/bin/gstat    ->      /usr/local/bin/fbstat
        /usr/local/bin/gsplit   ->      /usr/local/bin/fbsplit

9) Enjoy it ;)

要启动它,只需/etc/rc.conf按照第 4 点或第 5 点的消息中的指示添加,例如:

firebird_enable="YES"
firebird_mode="superserver"

要将其编译为非 root 用户,一种简单的方法是将端口目录的所有者更改为您的用户,例如:

# chown -R foo:foo /usr/ports/databases/firebird25-server

然后作为您的用户cd到端口并仅键入以下内容进行构建make

$ cd /usr/ports/databases/firebird25-server
$ make

然后切换回root安装端口:

# make install
于 2018-07-24T17:55:29.147 回答
0

这是我过去用来解决此问题的程序(基于 FreeBSD 10.2)。这适用于 firebird 客户端,但对于服务器应该类似。此过程假定为执行安装的用户设置了 sudo。

cd /usr/ports
sudo chown non-root-user-name distfiles   (was root)
cd /usr/ports/databases
sudo chown non-root-user-name firebird25-client   (was root)
cd /usr/ports/databases/firebird25-client
make -DPACKAGE_BUILDING   (Note:  No sudo is used here!  This process can take a long time.)
(Note:  You may be required to supply root password on this step)
make install clean  (Note:  You may be required to supply root password on this step)
cd /usr/ports
sudo chown root distfiles   
cd /usr/ports/databases
sudo chown root firebird25-client

至于 FreeBSD 11.x 和 Firebird...我看到了同样的“总线错误”。我现在已经得出结论(也许是错误的)Firebird 还不兼容 FreeBSD 11.x。如果您恢复到 FreeBSD 10.x,您应该不会看到这个问题。

于 2018-07-26T15:35:00.710 回答