Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Does anyone know of any reason why Apache2 and MySQL do not run after either a server reboot or apt-get update?

I am currently running Ubuntu 12.04 LTS server

There are the corresponding files in /etc/init.d/ for apache2 and mysql however they only work by manually starting / restarting. They never run automatically.

Ideally I would like them to run constantly as the website running needs them constantly.

The apache2 header init doesn't really different from any other i've seen:

#!/bin/sh
### BEGIN INIT INFO
# Provides:          apache2
# Required-Start:    $local_fs $remote_fs $network $syslog $named
# Required-Stop:     $local_fs $remote_fs $network $syslog $named
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# X-Interactive:     true
# Short-Description: Start/stop apache2 web server
### END INIT INFO

If anyone can help me in where to look or has seen this issue before, please I'd appreciate the help.

Update

After looking up the folder /etc/rc2.d/ there wasn't any link for mysql so i've now ran update-rc.d mysql defaults and it is in there now. There was already one for apache2

Seems that the error in apache2 error.log was a sigfault which is when the site went down

share|improve this question
2  
Are there any relevant messages in the apache or mysql logs ? –  Iain Jun 4 at 9:02
    
[Tue Jun 03 23:03:38 2014] [notice] caught SIGTERM, shutting down –  Grant Jun 4 at 9:49

2 Answers 2

I would recommend the following troubleshooting tips based on the INIT INFO you've pasted.

  • Check the dependent service (local_fs, network, syslog etc.,) and check for their status. These services are mentioned as mandatory dependencies and hence their failure would result in failure of apache as well.

  • Did you create soft links to the apache/mysql service in the appropriate runlevel using chkconfig command (or equivalent command for your linux flavor). If this is not executed, softlinks won't be created in the runlevels mentioned in the INIT INFO snippet. And hence, the services won't get loaded/executed during boot time...

share|improve this answer

Check if directory /etc/rc2.d/ contains symlink like this: S02apache2 -> ../init.d/apache2. If not, then the actual symlinks that start and stop services have gone missing for some reason. You can use update-rd.d to regenerate the links:

# update-rc.d apache2 defaults
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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