【发布时间】:2016-04-13 21:35:52
【问题描述】:
试图停止 Apache2 服务,但得到 PID 错误:
#service apache2 stop
[FAIL] Stopping web server: apache2 failed!
[....] There are processes named 'apache2' running which do not match your pid file which are left untouched in the name of safety, Plea[warnview the situation by hand. ... (warning).
试图杀死那些进程:
#kill -9 $(ps aux | grep apache2 | awk '{print $2}')
但它们会再次重生:
#ps aux | grep apache2
root 19279 0.0 0.0 4080 348 ? Ss 05:10 0:00 runsv apache2
root 19280 0.0 0.0 4316 648 ? S 05:10 0:00 /bin/sh /usr/sbin/apache2ctl -D FOREGROUND
root 19282 0.0 0.0 91344 5424 ? S 05:10 0:00 /usr/sbin/apache2 -D FOREGROUND
www-data 19284 0.0 0.0 380500 2812 ? Sl 05:10 0:00 /usr/sbin/apache2 -D FOREGROUND
www-data 19285 0.0 0.0 380500 2812 ? Sl 05:10 0:00 /usr/sbin/apache2 -D FOREGROUND
虽然进程正在运行,但我无法连接到端口 80 上的服务器。/var/log/apache2/error.log.1 在我执行 kill -9 时没有新消息。 在我尝试重新启动之前,一切都运行良好。 在 Debian 上运行:Linux adara 3.2.0-4-amd64 #1 SMP Debian 3.2.54-2 x86_64 GNU/Linux
更新: 也试过apache2ctl:
#/usr/sbin/apache2ctl -k stop
AH00526: Syntax error on line 76 of /etc/apache2/apache2.conf:
PidFile takes one argument, A file for logging the server process ID
Action '-k stop' failed.
The Apache error log may have more information.
但是 /var/run/apache2 中没有 pid 文件
我是 linux 新手,看起来它必须对启动脚本做一些事情,但无法弄清楚到底是什么。
【问题讨论】:
标签: linux debian apache2 init.d