systemd 没有注意到 apache 启动

systemd 没有注意到 apache 启动

我的 debian 系统已感染 systemd 病毒...

当我发出“service apache2 start”命令来启动 apache 时,它​​认为它失败了,但 apache 运行正常。因此“service apache2 stop”没有任何作用,因为系统认为 apache 尚未启动。要停止 apache,我必须发出“killall apache2”

# service apache2 start
Job for apache2.service failed. See 'systemctl status apache2.service' 
   and 'journalctl -xn' for details.


# systemctl status apache2.service 
â apache2.service - LSB: Apache2 web server
   Loaded: loaded (/etc/init.d/apache2)
   Active: failed (Result: exit-code) since Thu 2016-06-09 15:49:43 CEST; 32s ago
  Process: 7513 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILURE)

Jun 09 15:49:43  apache2[7513]: Starting web server: apache2 failed!
Jun 09 15:49:43  apache2[7513]: The apache2 instance did not start within 20 seconds. Please read the log files to discover problems ... (warning).
Jun 09 15:49:43  systemd[1]: apache2.service: control process exited, code=exited status=1
Jun 09 15:49:43  systemd[1]: Failed to start LSB: Apache2 web server.
Jun 09 15:49:43  systemd[1]: Unit apache2.service entered failed state.

系统是debian 8.5;经过多个版本升级。

为什么当 Apache 启动正常时,“系统”却认为它失败了?

[Thu Jun 09 16:11:40.945575 2016] [mpm_prefork:notice] [pid 13426] AH00163: Apache/2.4.10 (Debian) mod_python/3.3.1 Python/2.7.9 OpenSSL/1.0.1t configured -- resuming normal operations
[Thu Jun 09 16:11:40.945846 2016] [core:notice] [pid 13426] AH00094: Command line: '/usr/sbin/apache2'

更新 /etc/init.d/apache2 在以下位置查找 pidfile:

/var/运行/apache2/apache2.pid
,但文件实际上位于
/var/运行/apache2.pid
,即少了一个子目录。

答案1

pidfile 位于一个意外的位置。编辑

/etc/apache2/环境变量
线

导出 APACHE_PID_FILE=/var/run/apache2$SUFFIX.pid

使“服务 apache2 启动/停止”工作

相关内容