0

安装和尝试启动 Firebird 3.0 服务后出错。

Job for firebird3.0.service failed because a configured resource limit was exceeded. See "systemctl status firebird3.0.service" and "journalctl -xe" for details.

invoke-rc.d: initscript firebird3.0, action "start" failed.

dpkg: error processing package firebird3.0-server (--configure):
 subprocess installed post-installation script returned error exit status 1

Processing triggers for libc-bin (2.23-0ubuntu3) ...
Processing triggers for systemd (229-4ubuntu7) ...
Processing triggers for ureadahead (0.100.0-19) ...

Errors were encountered while processing:
 firebird3.0-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

从“service firebird3.0 start”查看返回:

Job for firebird3.0.service failed because a configured resource limit was exceeded. See "systemctl status firebird3.0.service" and "journalctl -xe" for details

请参阅“journalctl -xe”的返回:

-- Unit firebird3.0.service has begun starting up.
Ago 26 15:41:22 server14 systemd[1]: firebird3.0.service: PID file /var/run/firebird/3.0default.pid not readable (yet?) after start: No such file or directory
Ago 26 15:41:22 server14 firebird[3509]: Security database error
Ago 26 15:41:22 server14 systemd[1]: firebird3.0.service: Daemon never wrote its PID file. Failing.
Ago 26 15:41:22 server14 systemd[1]: Failed to start Firebird Database Server ( SuperServer ).
-- Subject: Unit firebird3.0.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit firebird3.0.service has failed.
-- 
-- The result is failed.
Ago 26 15:41:22 server14 systemd[1]: firebird3.0.service: Unit entered failed state.
Ago 26 15:41:22 server14 systemd[1]: firebird3.0.service: Failed with result 'resources'.

我已经尝试了很多事情来解决,但目前唯一的方法是手动启动:

start-stop-daemon   --quiet --start --exec /usr/sbin/fbguard --pidfile /var/run/firebird/3.0/firebird.pid -b -m -- -daemon -forever -pidfile /var/run/firebird/3.0/firebird.pid

和手动停止:

start-stop-daemon --stop --signal KILL --exec /usr/sbin/fbguard 
start-stop-daemon --stop --signal KILL --exec /usr/sbin/firebird

有任何想法吗?

4

1 回答 1

2

在基于 debian 的系统上安装时不会创建目录 /run/firebird/3.0。所以 systemd 脚本不起作用。

解决方法:

作为用户 root 做

  1. 创建目录: mkdir -p /run/firebird/3.0
  2. chown to firebird: chown -R firebird:firebird /run/firebird

完成此操作后,firebird 3.0 应按预期运行

由于 /run 通常是 Debian 中的临时目录,您可以更改 sytemd 启动脚本以始终在服务启动之前执行目录创建:

/lib/systemd/system/firebird3.0 应如下所示:

[Unit]
Description=Firebird Database Server ( SuperServer )
After=network.target
Conflicts=firebird3.0-classic.socket

[Service]
User=firebird
Group=firebird
Type=forking
# Run ExecStartPre with root-permissions
PermissionsStartOnly=true
ExecStartPre=-/bin/mkdir -p /run/firebird/3.0
ExecStartPre=/bin/chown -R firebird:firebird /run/firebird
PIDFile=/run/firebird/3.0/default.pid
ExecStart=/usr/sbin/fbguard -pidfile /run/firebird/3.0/default.pid -daemon -forever
RuntimeDirectory=firebird/3.0
StandardError=syslog

[Install]
WantedBy=multi-user.target

PermissionsStartOnly=true 是能够以 root 身份执行除服务本身 (ExecStart) 之外的所有语句所必需的。这对于在 /run 中创建子目录很重要。顺便说一句:第一个 ExecStartPre 行中的 -(减号)使脚本运行时不会因目录创建返回的错误而停止,如果目录存在(例如在服务重新启动后)会有所帮助。

不要忘记重新加载 systemd:systemctl --system daemon-reload

于 2016-11-19T12:04:17.097 回答