firebird3.0.service的作业失败,因为超出了已配置的资源限制

时间:2016-08-26 18:44:21

标签: linux ubuntu firebird ubuntu-16.04 firebird-3.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

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

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

解决方法:

以root用户身份

  1. 创建目录: mkdir -p /run/firebird/3.0
  2. chown to firebird: chown -R firebird:firebird / run / firebird
  3. 执行此操作后,firebird 3.0应按预期运行

    由于/正常运行是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