Server is a Xen VPS running Ubuntu 12.04 and neither nginx nor NSD3 come up after reboot. The apparent reason for that is that they're not able to bind to their assigned IP addresses right after boot,
* Starting configure network device [ OK ] * Stopping save kernel messages [ OK ] * Starting MTA [ OK ] nginx: [emerg] bind() to [2a01:1b0:removed:1c9c]:80 failed (99: Cannot assign requested address) * Starting nsd3... [ OK ] [...] * Starting configure virtual network devices [ OK ] * Stopping configure virtual network devices [ OK ]
 nsd: error: can't bind udp socket: Cannot assign requested address  nsd: error: server initialization failed, nsd could not be started
Everything works fine after a couple of seconds, and both nginx and NSD3 can be started.
It seems to me that the problem is in the wrong boot order, nginx and NSD3 are started before the network configuration can fully take place. I worked around it by putting
# nginx and nsd boot fix sleep 4 /etc/init.d/nsd3 start /etc/init.d/nginx start
in /etc/rc.local but that's not a proper solution. What is the right way to handle this issue?
Here's my basic network configuration, from /etc/network/interfaces auto eth0
iface eth0 inet static address 89.removed.121 gateway 89.removed.1 netmask 255.255.255.0 iface eth0 inet6 static up echo 0 > /proc/sys/net/ipv6/conf/all/autoconf up echo 0 > /proc/sys/net/ipv6/conf/default/autoconf netmask 64 gateway 2a01:removed:0001 address 2a01:removed:7c3b up ip addr add 2a01:removed:62bd dev eth0 preferred_lft 0 up ip addr add 2a01:removed:ce6d dev eth0 preferred_lft 0 up ip addr add 2a01:removed:3e13 dev eth0 preferred_lft 0 up ip addr add 2a01:removed:1c9c dev eth0 preferred_lft 0 auto lo iface lo inet loopback
Those awkward up id addr are there because I wanted to add additional IPs but still use the first one for all traffic originating from the server.