Wednesday 14 November 2018

linux - How to get Apache2 to wait for network initialization?

Server just upgraded from Squeeze to Wheezy. After reboots, I noted that apache2 wasn't starting, so installed bootlogd to inspect the output of init scripts.


The error output from apache start was,


Tue Feb  3 08:49:55 2015: [....] Starting web server: apache2(99)Cannot assign requested address: make_sock: could not bind to address [0123:4567:890:abc::d]:80
Tue Feb 3 08:49:55 2015: no listening sockets available, shutting down
Tue Feb 3 08:49:55 2015: Unable to open logs
Tue Feb 3 08:49:55 2015: Action 'start' failed.
Tue Feb 3 08:49:55 2015: The Apache error log may have more information.

Timestamps in the boot output show 4s between "Configuring network interfaces" (08:49:51) and starting apache.


I've worked around this by inserting a sleep 5 into /etc/init.d/apache2 after which apache2 starts fine, so I'm reading it as slow network initialization (possibly specific to IPv6 networking). The server is running on VMWare, and I have access only to the VM.



  • What better methods could I use to make Apache wait a few seconds and check its addresses are up and running before start?

  • Or to make the network init script not exit until the addresses are ready?

No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...