如何从 systemd 发行版中的 httpd 获取详细的错误消息?
Fedora 更改为 systemd,因此现在当我尝试启动 httpd 时,我收到错误消息
[]$ systemctl restart httpd.service
Job failed. See system logs and 'systemctl status' for details.
当我查看 /var/log/httpd/error_log 时,我没有看到任何启动错误消息。 当我查看 /var/log/messages 时,我没有看到任何启动错误消息。他们在哪里?我需要启用一个选项吗?
忘记添加以下命令响应
[]$ systemctl status httpd.service
httpd.service - LSB: start and stop Apache HTTP Server
Loaded: loaded (/etc/rc.d/init.d/httpd)
Active: failed since Tue, 24 Jan 2012 23:32:37 +0000; 8min ago
Process: 1061 ExecStart=/etc/rc.d/init.d/httpd start (code=exited, status=1/FAILURE)
CGroup: name=systemd:/system/httpd.service
Fedora changed to systemd so now when I try to start httpd I get the error message
[]$ systemctl restart httpd.service
Job failed. See system logs and 'systemctl status' for details.
When I look in /var/log/httpd/error_log I do not see any startup error messages.
When I look in /var/log/messages I do not see any startup error messages. Where are they? Do I need to enable an option?
Forgot to add the following command response
[]$ systemctl status httpd.service
httpd.service - LSB: start and stop Apache HTTP Server
Loaded: loaded (/etc/rc.d/init.d/httpd)
Active: failed since Tue, 24 Jan 2012 23:32:37 +0000; 8min ago
Process: 1061 ExecStart=/etc/rc.d/init.d/httpd start (code=exited, status=1/FAILURE)
CGroup: name=systemd:/system/httpd.service
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
默认情况下,写入标准输出或标准错误的任何内容都应该发送到
/var/log/messages
- 这是从 F16 开始的标准systemd
行为。对于
httpd
,大多数错误也可能在发送到控制台的同时发送到/var/log/httpd/error_log
。如果您仍然使用 F15,那么事情会更棘手,您可能必须避开
systemd
才能看到发送到控制台的任何内容,因为它不会捕获日志的输出。在您的环境中设置SYSTEMCTL_SKIP_REDIRECT
,并使用/etc/init.d/httpd start
启动httpd
来查看它们。Anything that was written to standard output or standard error should have been sent to
/var/log/messages
by default - that is standardsystemd
behaviour from F16 on.With
httpd
most errors are also likely to have been sent to/var/log/httpd/error_log
at the same time that they were sent to the console.If you're still on F15 then things are trickier, and you will probably have to dodge
systemd
to see anything that was sent to the console as it doesn't capture the output to the log. SetSYSTEMCTL_SKIP_REDIRECT
in your environment and starthttpd
with/etc/init.d/httpd start
to see them.