Apache trying to start before network interfaces are up

Bug #353594 reported by Nick Hemsley
2
Affects Status Importance Assigned to Milestone
apache2 (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: apache2

Apache fails to start when I boot my system (Intrepid Desktop). The init scripts report this error:

apache2: Could not reliably determine the server's fully qualified domain name,
using 127.0.1.1 for ServerName
(99)Cannot assign requested address: make_sock: could not bind to address 192.168.0.145:80
no listening sockets available, shutting down
Unable to open logs
                                                                         [fail]

*****************

Modifying the init.d script to output the result of ifconfig, shows that only lo is up at the time of running this script, so I assume the apache init script is being called in the wrong order (before NetworkManager)

`ls /etc/r2.d` shows this (indicating that apache runs after NetworkManager, meaning the interfaces should be up):

S01policykit -> ../init.d/policykit
S05vbesave -> ../init.d/vbesave
S10acpid -> ../init.d/acpid
S10powernowd.early -> ../init.d/powernowd.early
S10sysklogd -> ../init.d/sysklogd
S10xserver-xorg-input-wacom -> ../init.d/xserver-xorg-input-wacom
S11klogd -> ../init.d/klogd
S12dbus -> ../init.d/dbus
S14avahi-daemon -> ../init.d/avahi-daemon
S16ssh -> ../init.d/ssh
S19postgresql-8.3 -> ../init.d/postgresql-8.3
S20apmd -> ../init.d/apmd
S20apport -> ../init.d/apport
S20cups -> ../init.d/cups
S20denyhosts -> ../init.d/denyhosts
S20dkms_autoinstaller -> ../init.d/dkms_autoinstaller
S20freenx-server -> ../init.d/freenx-server
S20gpm -> ../init.d/gpm
S20hotkey-setup -> ../init.d/hotkey-setup
S20mongrel -> ../init.d/mongrel
S20powernowd -> ../init.d/powernowd
S20psad -> ../init.d/psad
S20rsync -> ../init.d/rsync
S20samba -> ../init.d/samba
S20vboxdrv -> ../init.d/vboxdrv
S24hal -> ../init.d/hal
S25bluetooth -> ../init.d/bluetooth
S25pulseaudio -> ../init.d/pulseaudio
S28NetworkManager -> ../init.d/NetworkManager
S30gdm -> ../init.d/gdm
S30system-tools-backends -> ../init.d/system-tools-backends
S89anacron -> ../init.d/anacron
S89atd -> ../init.d/atd
S89cron -> ../init.d/cron
S90binfmt-support -> ../init.d/binfmt-support
S91apache2 -> ../init.d/apache2
S98usplash -> ../init.d/usplash
S99acpi-support -> ../init.d/acpi-support
S99laptop-mode -> ../init.d/laptop-mode
S99rc.local -> ../init.d/rc.local
S99rmnologin -> ../init.d/rmnologin
S99stop-readahead -> ../init.d/stop-readahead

*****
Description: Ubuntu 8.10
Release: 8.10

apache2:
  Installed: 2.2.9-7ubuntu3
  Candidate: 2.2.9-7ubuntu3
  Version table:
 *** 2.2.9-7ubuntu3 0
        500 http://ftp.iinet.net.au intrepid/main Packages
        100 /var/lib/dpkg/status

**************

Expected Behavior:

Network Interfaces are up correctly by the time the apache startup script runs
Apache starts up normally

Actual Behaviour:

Only the 'lo' network interface is showing in ifconfig
Apache fails to start. (Cannot assign requested address: make_sock: could not bind to address 192.168.0.145:80)

Revision history for this message
Nick Hemsley (nick-hems) wrote :

Adding the line:

sleep 10

to the /etc/init.d/apache2 script before starting the daemon, fixes the problem (workaround).

Revision history for this message
Mathias Gug (mathiaz) wrote : Re: [Bug 353594] [NEW] Apache trying to start before network interfaces are up

Thank you for taking the time to report this bug and helping to make
Ubuntu better.

On Thu, Apr 02, 2009 at 04:39:10AM -0000, Nick Hemsley wrote:
> Apache fails to start when I boot my system (Intrepid Desktop). The init scripts report this error:
>
> apache2: Could not reliably determine the server's fully qualified domain name,
> using 127.0.1.1 for ServerName
> (99)Cannot assign requested address: make_sock: could not bind to address 192.168.0.145:80
> no listening sockets available, shutting down
> Unable to open logs
> [fail]
> Modifying the init.d script to output the result of ifconfig, shows that
> only lo is up at the time of running this script, so I assume the apache
> init script is being called in the wrong order (before NetworkManager)

Are you running NetworkManager in system mode or session mode? If the
latter network will come up only when a user has actually logged in.

 status incomplete

--
Mathias Gug
Ubuntu Developer http://www.ubuntu.com

Changed in apache2 (Ubuntu):
status: New → Incomplete
Revision history for this message
Nick Hemsley (nick-hems) wrote :

All the settings are set to "system settings". I assume that this is what you mean by system mode.

Apologies, I thought I had already responded to this comment.

Revision history for this message
Alex F (frase) wrote :

I'm having a similar problem and I wonder if it's related. In my case, I have a script that mounts network shares which is called from rc.local. During boot, the mounts all fail because the network isn't configured yet; mounts by hostname fail DNS lookup, and mounts by IP report "network is unreachable". The same script run after booting mounts everything just fine.

I also can't figure out what is meant by "NetworkManager in system mode"; my networks (as defined in NM) are marked "available to all users" which I assumed would make them "system-level" networks, but they still don't seem to be available at boot time when rc.local is run.

Revision history for this message
Chuck Short (zulcss) wrote :

Nick,

I was wondering if you were still having this problem.

Thanks
chuck

@Alex F,

Please open a seperate bug for your case.

Thanks
chuck

Revision history for this message
Chuck Short (zulcss) wrote :

We'd like to figure out what's causing this bug for you, but we haven't heard back from you in a while. Could you please provide the requested information? Thanks!

Revision history for this message
Nick Hemsley (nick-hems) wrote :

Chuck,

Apologies for not getting back sooner. This machine is with an old employer. Enough said.

This bug should probably get closed, as I have no access to the machine in question.

Nick

Revision history for this message
Mathias Gug (mathiaz) wrote :

Closing the bug as mentioned by the reporter.

Changed in apache2 (Ubuntu):
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.