Ubuntu 16.04:apache2.service 启动失败,分段错误(核心转储)

Ubuntu 16.04:apache2.service 启动失败,分段错误(核心转储)

昨天我从 14.04 升级到了 16.04.2。

升级后,我的 apache2 服务无法启动,错误:

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

我知道有很多用户遇到过这种情况,但和我遇到的情况不太一样。输出中没有有用的错误。只是一个通用的分段失败错误。

systemctl status apache2.service

apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
           └─apache2-systemd.conf
Active: failed (Result: exit-code) since Wed 2017-04-12 22:13:22 SGT; 11s ago
Docs: man:systemd-sysv-generator(8)
Process: 11446 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILURE)
Apr 12 22:13:22 ip-172-31-15-210 apache2[11446]:  *
Apr 12 22:13:22 ip-172-31-15-210 apache2[11446]:  * The apache2 configtest failed.
Apr 12 22:13:22 ip-172-31-15-210 apache2[11446]: Output of config test was:
Apr 12 22:13:22 ip-172-31-15-210 apache2[11446]: Segmentation fault (core dumped)
Apr 12 22:13:22 ip-172-31-15-210 apache2[11446]: Action 'configtest' failed.
Apr 12 22:13:22 ip-172-31-15-210 apache2[11446]: The Apache error log may have more information.
Apr 12 22:13:22 ip-172-31-15-210 systemd[1]: apache2.service: Control process exited, code=exited status=1
Apr 12 22:13:22 ip-172-31-15-210 systemd[1]: Failed to start LSB: Apache2 web server.
Apr 12 22:13:22 ip-172-31-15-210 systemd[1]: apache2.service: Unit entered failed state.
Apr 12 22:13:22 ip-172-31-15-210 systemd[1]: apache2.service: Failed with result 'exit-code'.

journalctl -xe

Apr 12 22:13:22 ip-172-31-15-210 systemd[1]: Starting LSB: Apache2 web server...
-- Subject: Unit apache2.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit apache2.service has begun starting up.
Apr 12 22:13:22 ip-172-31-15-210 apache2[11446]:  * Starting Apache httpd web server apache2
Apr 12 22:13:22 ip-172-31-15-210 kernel: /usr/sbin/apach[11458]: segfault at 5 ip 00007f483f0db997 sp 00007ffd0d8f13e0 error 4 in Util.so[7f483f0d3000+b000]
Apr 12 22:13:22 ip-172-31-15-210 apache2[11446]:  *
Apr 12 22:13:22 ip-172-31-15-210 apache2[11446]:  * The apache2 configtest failed.
Apr 12 22:13:22 ip-172-31-15-210 apache2[11446]: Output of config test was:
Apr 12 22:13:22 ip-172-31-15-210 apache2[11446]: Segmentation fault (core dumped)
Apr 12 22:13:22 ip-172-31-15-210 apache2[11446]: Action 'configtest' failed.
Apr 12 22:13:22 ip-172-31-15-210 apache2[11446]: The Apache error log may have more information.
Apr 12 22:13:22 ip-172-31-15-210 systemd[1]: apache2.service: Control process exited, code=exited status=1
Apr 12 22:13:22 ip-172-31-15-210 systemd[1]: Failed to start LSB: Apache2 web server.
-- Subject: Unit apache2.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit apache2.service has failed.
-- 
-- The result is failed.
Apr 12 22:13:22 ip-172-31-15-210 systemd[1]: apache2.service: Unit entered failed state.
Apr 12 22:13:22 ip-172-31-15-210 systemd[1]: apache2.service: Failed with result 'exit-code'.

我尝试过清除并安装 apache2、libapache2-mod-php7.0、libapache2-mod-perl。没有安装 php5(Ubuntu 在升级过程中将其删除。)

有人对我还能做什么有什么意见吗?

编辑1: 在核心转储上使用 gdb 得到以下结果:

[New LWP 12661]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/usr/sbin/apache2 -t'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007fb84d424997 in boot_List__Util (my_perl=0x5595f24c3840, 
    cv=0x5595f27e76e0) at ListUtil.c:1793
1793        dVAR; dXSARGS;

答案1

终于在这里找到了答案!https://stackoverflow.com/questions/39310952/upgraded-ubuntu-from-14-04-lts-to-16-04-lts-and-bugzilla-stopped-working/43438371#43438371

我决定禁用所有 apache 配置并逐个启用。当我启用 Bugzilla 特定的配置时,apache2 重新加载失败。看起来它的 perl 模块与 Ubuntu 16.04 冲突。我使用 CPAN 更新 perl 模块,将 bugzilla/lib 重命名为 bugzilla/lib.old 并运行 bugzilla/checksetup.pl。

该脚本重新创建了 bugzilla/lib 内容,并且 apache2 重新加载成功。

相关内容