Apache2 and sysvinit vs systemd

I am unfamiliar with sysvinit and systemd but after upgrading to 12.1 I find that apache no longer starts. The workaround is apparently install sysvinit-init, which yast tells me requires deinstallation of systemd-sysvinit. Is that safe? Won’t that break new stuff that was installed with 12.1?

You don’t need to do that. I don’t have sysvinit-init installed and I can boot using sysv. Just add init=/sbin/sysvinit to your boot parameters either temporarily at GRUB or permanently by editing /boot/grub/menu.lst.

However I recall that I did not have problems with systemd and Apache, but I can’t be sure because I switched to sysv, because of other issues. Make sure you have the latest updates, there was a new systemd package recently.

Thanks for your reply. I don’t know what this does, but I added init=/sbin/sysvinit to menu.lst and rebooted. Now I get:

> sudo /etc/init.d/apache2 start
Starting httpd2 (prefork) Inconsistency detected by ld.so: dl-open.c: 596: _dl_open: Assertion `_dl_debug_initialize (0, args.nsid)->r_state == RT_CONSISTENT' failed!

The command line was:
/usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf

It looks like the sysvinit parameter worked, but there’s something else wrong? On preliminary research I can’t find anything about this new error…I rarely see assertions fail straight out of C code from a script launch. Either way, pre-12.1, apache launched correctly, but I don’t know if this new error has anything to do with systemd or not.

My 12.1 Apache runs fine under sysv (and I think it did under systemd). Knowing how services work under Linux, I seriously doubt if the service manager has anything to do with this error. It feels more like you have missing Apache components or corrupted files. I would suggest reinstalling the entire LAMP pattern, then applying all updates, just in case there was a problem with the Apache released on the master media. Actually if you haven’t applied all updates yet, you should try this first, since it’s easy to do.

You might also try disabling apparmor, that caused problems with a couple of other services I run.

Fixed it! It was indeed a problem with Apache configuration, apparently caused by upgrading from 11.4 to 12.1. If anyone knows the best place to report this, please let me know.

When I went to uninstall PHP5 I found it was mysteriously not present. I reinstalled it and got the same error but noticed that PHP5 requires Apache2 prefork (IIRC) and my software manager showed several versions of Apache2 installed, not just prefork (the others being event, and threaded, or something along those lines). I uninstalled all of them and reinstalled PHP5, letting the package manager resolve the apache dependencies, and it worked. My httpd configs are totally borked now tho :confused:

[Edit for future reference: my configs were borked because reinstalling apache overwrote apache settings files. In my case the relevant files turned out to be /etc/apache2/listen.conf, and the package manager was nice enough to save the old copy in /etc/apache2/listen.conf.rpmsave, so I was able to easily reinstate my server config.]

Thanks for your help guys.

I had many services that were not starting properly under systemd. I didn’t look into why. how, or anything else. I simply installed sysvinit, it removed systemd and all has been working flawlessly for me.

mythbackend, mysql, apache…would not start under systemd, they all work perfectly under sysvinit

On 2012-01-11 11:36, sp3wn wrote:
> Fixed it! It was indeed a problem with Apache configuration, apparently
> caused by upgrading from 11.4 to 12.1. If anyone knows the best place
> to report this, please let me know.

Did you revise the configuration files .rpmnew and .rpmsave after the
upgrade? There is a long list in “/var/adm/rpmconfigcheck” of files you
have to manually review after upgrading.

If you did this properly, and still you had a bug, then the place to report
is Bugzilla, obviously.

Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

Thanks to HowToForge I found an idea to start Apache and Postfix under systemd:

systemctl enable apache2
systemctl enable postfix

These commands (run once) create some links that seem to be necessary for perfect starting these services.