0

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.

jcisio
  • 588
  • 1
  • 9
  • 22
  • What Linux distribution is this? What virtualization technology? – Michael Hampton Mar 01 '13 at 00:21
  • Looks like `192.168.1.30` just doesn't exist at boot time. – VBart Mar 01 '13 at 03: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 01 '13 at 09:49
  • 1
    Do you actually need nginx to bind to a specific IP instead of all IPs? – mgorven Mar 01 '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 02 '13 at 07:10
  • home and end user question are offtopic. regardless that thia question is from '13 – djdomi Feb 19 '22 at 14:52

1 Answers1

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.

han
  • 11
  • 1