When I reboot my server (not nginx, the whole server), Nginx fails to start automatically. After I logged into the server, I can start nginx manually (service nginx start). It works. But if I restart again, I have to manually start Nginx.

In /var/log/boot.log the last lines are:

 * Starting configure virtual network devices^[[74G[ OK ]^M 
Starting nginx: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok^M
nginx: [emerg] bind() to failed (99: Cannot assign requested address)^M
nginx: configuration file /etc/nginx/nginx.conf test failed^M
speech-dispatcher disabled; edit /etc/default/speech-dispatcher^M
 * Starting VirtualBox kernel modules       ^[[80G ^M^[[74G[ OK ]^M
 ^[[33m*^[[39;49m VirtualBox Additions disabled, not in a Virtual Machine^M
 * Starting MDM Display Manager mdm       ^[[80G ^M^[[74G[ OK ]^M
saned disabled; edit /etc/default/saned^M

This is a Linux Mint 14 XFCE box with nginx installed from the official repository. It is in fact my dev PC, no virtualization, with a SSD and it boots in less than 10 seconds.

  • What Linux distribution is this? What virtualization technology? – Michael Hampton Mar 1 '13 at 0:21
  • Looks like just doesn't exist at boot time. – VBart Mar 1 '13 at 3:18
  • I added more detail. It indeed seems like IP assignation problem. I just don't know how it happens nor how to debug. nginx is on the last lines of the /var/log/boot.log. The IP is fixed and assigned by a DHCP server (which is a set-top-box). – jcisio Mar 1 '13 at 9:49
  • 1
    Do you actually need nginx to bind to a specific IP instead of all IPs? – mgorven Mar 1 '13 at 17:22
  • Great comment. Not really. I do need to separate sites from LAN and from Internet (which I have port forwarding on router), I also use iptables to forward things line to another host in a ssh tunnel. But all of them do not require to bind nginx to a specific IP as I thought. I already use different hostnames. – jcisio Mar 2 '13 at 7:10

AT the boot time, your network isn't availiable yet, and mysql tries to bind to an ip address that does'nt exist. You should set your mysql startup script to start after network.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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