Apache trying to start before network interfaces are up
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
*****************
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.
S10sysklogd -> ../init.d/sysklogd
S10xserver-
S11klogd -> ../init.d/klogd
S12dbus -> ../init.d/dbus
S14avahi-daemon -> ../init.
S16ssh -> ../init.d/ssh
S19postgresql-8.3 -> ../init.
S20apmd -> ../init.d/apmd
S20apport -> ../init.d/apport
S20cups -> ../init.d/cups
S20denyhosts -> ../init.d/denyhosts
S20dkms_
S20freenx-server -> ../init.
S20gpm -> ../init.d/gpm
S20hotkey-setup -> ../init.
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.
S28NetworkManager -> ../init.
S30gdm -> ../init.d/gdm
S30system-
S89anacron -> ../init.d/anacron
S89atd -> ../init.d/atd
S89cron -> ../init.d/cron
S90binfmt-support -> ../init.
S91apache2 -> ../init.d/apache2
S98usplash -> ../init.d/usplash
S99acpi-support -> ../init.
S99laptop-mode -> ../init.
S99rc.local -> ../init.d/rc.local
S99rmnologin -> ../init.d/rmnologin
S99stop-readahead -> ../init.
*****
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://
100 /var/lib/
**************
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)
Adding the line:
sleep 10
to the /etc/init.d/apache2 script before starting the daemon, fixes the problem (workaround).