1

Yesterday I upgraded from 14.04 to 16.04.2.

After the upgrade, my apache2 service would not start, error:

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

I know there are many users who faced this, but not quite what I am facing. There is no helpful error in the outputs. Just a generic segmentation failed error.

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'.

I've tried purging and installing apache2, libapache2-mod-php7.0, libapache2-mod-perl. There is no php5 installed (Ubuntu removed it during the upgrade.)

Anyone have any opinions on what else can I do?

EDIT 1: Using gdb on the core dump gives this:

[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;
  • What is in your apache2-systemd.conf file? Have you had a look at the core dump files using something like gdb /path/to/application /path/to/corefile ? Are you able to re-install php5, or any other PHP packages/versions? – FCTW Apr 12 '17 at 15:04
  • Did you try to do a config test and see if there's something wrong? Try using : apachectl configtest – Adonist Apr 12 '17 at 16:06
  • @FCTW apache2-systemd.conf contents: ` [Service] Type=forking RemainAfterExit=no` There's no libapache2-mod-php5* package available, so can't install anything but 7.0 – Terence Apr 12 '17 at 16:57
  • @Adonist It gives: === Segmentation fault (core dumped) Action 'configtest' failed. The Apache error log may have more information. === apache error log is empty – Terence Apr 12 '17 at 16:59
  • I've edited the original question to include gdb output on the core dump. – Terence Apr 12 '17 at 17:24
1

Finally found an answer here! https://stackoverflow.com/questions/39310952/upgraded-ubuntu-from-14-04-lts-to-16-04-lts-and-bugzilla-stopped-working/43438371#43438371

I had decided to disable all apache config and enable one by one. And apache2 reload failed when I enabled the Bugzilla-specific config. Looks like it's perl modules were conflicting with Ubuntu 16.04. I used CPAN to update perl modules, renamed bugzilla/lib to bugzilla/lib.old and ran bugzilla/checksetup.pl.

The script recreated the bugzilla/lib contents, and apache2 reload was successful.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.