【问题标题】:apache2.service: Failed to run 'start' task: No such file or directoryapache2.service:无法运行“启动”任务:没有这样的文件或目录
【发布时间】:2019-02-09 17:15:20
【问题描述】:

我无法在 debian 9 上启动我的 apache 服务器。

我尝试重新安装:

sudo apt-get autoremove --purge apache2 && sudo apt-get install apache2

但没有变化...

Job for apache2.service failed because of unavailable resources or another system error.
See "systemctl status apache2.service" and "journalctl -xe" for details.
invoke-rc.d: initscript apache2, action "restart" failed.

systemctl status apache2.service

● apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
   Active: failed (Result: resources)

journalctl -xeu apache2.service (我将 loglevel 设置为 debug mod)

Sep 05 11:45:44 systemd[1]: apache2.service: Failed with result 'resources'.
Sep 05 11:50:26 systemd[1]: apache2.service: Changed dead -> failed
Sep 05 11:50:27 systemd[1]: apache2.service: Trying to enqueue job apache2.service/stop/replace
Sep 05 11:50:27 systemd[1]: apache2.service: Installed new job apache2.service/stop as 1415
Sep 05 11:50:27 systemd[1]: apache2.service: Enqueued job apache2.service/stop as 1415
Sep 05 11:50:27 systemd[1]: apache2.service: Job apache2.service/stop finished, result=done
Sep 05 11:50:27 systemd[1]: apache2.service: Changed dead -> failed
Sep 05 11:50:30 systemd[1]: apache2.service: Failed to run 'start' task: No such file or directory
Sep 05 11:50:30 systemd[1]: Failed to start The Apache HTTP Server.
-- Subject: Unit apache2.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- Unit apache2.service has failed.
-- 
-- The result is failed.
Sep 05 11:50:30 systemd[1]: apache2.service: Failed with result 'resources'.

怎么了?

【问题讨论】:

    标签: apache debian apache2 systemd


    【解决方案1】:

    也许这是服务“tmp”目录的问题。我对 systemd-resolved.service 有类似的错误,原因是系统迁移后缺少“/var/tmp”目录。检查服务正在使用的临时目录并在必要时创建它。

    【讨论】:

      【解决方案2】:

      另外,如果 /var/tmp/ 中有新运行的 systemd 和废话,您可能需要清除这些废话并再次尝试运行服务。

      就我而言,结果是这样的(当时没有运行 apache2):

      root@www:/var/tmp # ls -al
      total 32
      drwxrwxrwt  8 root root 4096 Dec 15 12:48 .
      drwxr-xr-x 14 root root 4096 Jul  8 21:43 ..
      drwx------  2 root root 4096 Dec 15 12:48 systemd-private-1dcdfe608b6c41f387936225d86126c7-apache2.service-L0KeaS
      drwx------  2 root root 4096 Dec  8 03:09 systemd-private-39294ac7bf4b44198d87d45660dcbac2-phpsessionclean.service-4ShLZm
      drwx------  2 root root 4096 Dec 15 04:00 systemd-private-451ad0c3bfe6435891a80a6c714a222b-apache2.service-YQyZes
      drwx------  2 root root 4096 Dec 15 07:09 systemd-private-451ad0c3bfe6435891a80a6c714a222b-phpsessionclean.service-5L25TU
      drwx------  3 root root 4096 Dec 15 03:53 systemd-private-68bc1493e8804c968af642a2319c4e79-apache2.service-RY1iLF
      

      【讨论】:

        猜你喜欢
        • 2013-08-08
        • 1970-01-01
        • 2012-07-03
        • 1970-01-01
        • 2020-09-23
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-01-09
        相关资源
        最近更新 更多