Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 192.168.1.30:80 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.

share|improve this question
    
What Linux distribution is this? What virtualization technology? –  Michael Hampton Mar 1 '13 at 0:21
    
Looks like 192.168.1.30 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 127.0.1.2:80 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

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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