【问题标题】:problems centos 7 httpd service restartcentos 7 httpd服务重启问题
【发布时间】:2020-10-21 12:38:17
【问题描述】:

当我输入 systemctl restart httpd 时,

我收到以下错误:

Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.

当我输入 systemctl status httpd.service

httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)
   Active: failed (Result: exit-code) since Wed 2020-07-01 00:45:46 COT; 16s ago
  Process: 1927 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=0/SUCCESS)
  Process: 23178 ExecReload=/usr/sbin/httpd $OPTIONS -k graceful (code=exited, status=0/SUCCESS)
  Process: 1925 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
 Main PID: 1925 (code=exited, status=1/FAILURE)
   Status: "Total requests: 657; Current requests/sec: -30.7; Current traffic:   0 B/sec"


Jul 01 00:45:46 sitio.co systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Jul 01 00:45:46 sitio.co systemd[1]: Failed to start The Apache HTTP Server.
Jul 01 00:45:46 sitio.co systemd[1]: Unit httpd.service entered failed state.
Hint: Some lines were ellipsized, use -l to show in full.

对于journalctl -xe

Jul 01 01:05:01 sitio.co CROND[2219]: (root) CMD (/usr/local/maldetect/maldet --mkpubpaths >> /dev/null 2>&1)
Jul 01 01:09:23 sitio.co systemd[1]: Starting The Apache HTTP Server...
-- Subject: Unit httpd.service has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit httpd.service has begun starting up.
Jul 01 01:09:24 sitio.co systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Jul 01 01:09:24 sitio.co systemd[1]: Failed to start The Apache HTTP Server.
-- Subject: Unit httpd.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit httpd.service has failed.
--
-- The result is failed.
Jul 01 01:09:24 sitio.co systemd[1]: Unit httpd.service entered failed state.
Jul 01 01:09:48 sitio.co postfix/qmgr[2155]: 968D275E: from=<root@sitio.co>, size=3215, nrcpt=1 (queue active)
Jul 01 01:09:48 sitio.co postfix/smtp[2303]: warning: database /etc/postfix/generic.db is older than source file /etc/postfix/generic
Jul 01 01:09:49 sitio.co postfix/smtp[2303]: 968D275E: to=<sistemas.revistas@correounivalle.edu.co>, relay=smtp.gmail.com[173.194.217.109]:587, delay=42
Jul 01 01:10:01 sitio.co systemd[1]: Created slice user-0.slice.
-- Subject: Unit user-0.slice has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit user-0.slice has finished starting up.
--
-- The start-up result is done.
Jul 01 01:10:01 sitio.co systemd[1]: Starting Session 76464 of user root.
-- Subject: Unit session-76464.scope has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit session-76464.scope has begun starting up.
Jul 01 01:10:01 sitio.co systemd[1]: Started Session 76464 of user root.
-- Subject: Unit session-76464.scope has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit session-76464.scope has finished starting up.
--
-- The start-up result is done.
Jul 01 01:10:01 sitio.co CROND[2306]: (root) CMD (/usr/local/maldetect/maldet --mkpubpaths >> /dev/null 2>&1)

对于systemctl status httpd.service -l

httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)
   Active: failed (Result: exit-code) since Wed 2020-07-01 01:09:24 COT; 4min 24s ago
  Process: 2296 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=0/SUCCESS)
  Process: 23178 ExecReload=/usr/sbin/httpd $OPTIONS -k graceful (code=exited, status=0/SUCCESS)
  Process: 2294 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
 Main PID: 2294 (code=exited, status=1/FAILURE)
   Status: "Total requests: 657; Current requests/sec: -30.7; Current traffic:   0 B/sec"

Jul 01 01:09:24 sitio.co systemd1: httpd.service: 主进程 已退出,code=exited,status=1/FAILURE

Jul 01 01:09:24 sitio.co systemd1: Apache HTTP 启动失败 服务器。

Jul 01 01:09:24 sitio.co systemd1: 单位 httpd.service 输入失败 状态。

查看最后的日志:

enter image description here

enter image description here

【问题讨论】:

  • 发布有问题的journalctl -xesystemctl status httpd.service -l 命令输出。
  • 检查服务器日志文件。
  • @Pandurang 已编辑!
  • @kjohri 现在在图像中是日志

标签: linux apache centos centos7


【解决方案1】:

停止 Apache httpd 服务并检查 apache 用户拥有的信号量使用情况。

ipcs -s

执行以下命令清除 Apache 用户使用的信号量。

ipcs -s | awk -v user=apache '$3==user {system("ipcrm -s "$2)}'

您可以参考Link了解更多信息。

【讨论】:

  • 您好,感谢您的回复,现在它显示“Active: active (running) since Wed 2020-07-01 01:49:09 COT; 3min 21s ag”但服务器继续“服务不可用。请稍后再试。”
  • 对不起,我添加了一张新图片
  • 别担心,我修好了
猜你喜欢
  • 2016-10-29
  • 2018-06-21
  • 2017-08-30
  • 2020-11-11
  • 1970-01-01
  • 2018-03-04
  • 2015-11-20
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多