Nginx not started after reboot

  • I have a little issue when I reboot my server, nginx does not start automatically. This issue has been persistent for a while now but is no big deal as running "service nginx start" solves it. I haven't posted about it because I have been trying to figure it out myself but no errors in any logs give me any clue. Good thing linux rarely needs rebooting. I will add that I have modified no files on system at all. Started from a fresh install of Debian with the minimum required packages and installed i-MSCP only ...
    I have tried searching in forums and have found nothing describing the issue I have. As I stated, not a major deal, but thought you might know of something I am missing.


    As always, much appreciation for you and all developers hard work ... :D


    Debian 8.6
    i-MSCP 1.3.10 Horner
    PHP-FPM

    “Life is all an Elaborate Hoax”

  • And you ?

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • This is what I have


    # systemctl enable nginx
    Synchronizing state for nginx.service with sysvinit using update-rc.d...
    Executing /usr/sbin/update-rc.d nginx defaults
    Executing /usr/sbin/update-rc.d nginx enable
    # systemctl status nginx
    ● nginx.service - A high performance web server and a reverse proxy server
    Loaded: loaded (/lib/systemd/system/nginx.service; enabled)
    Active: active (running) since Tue 2016-12-20 11:27:12 CST; 1min 30s ago
    Main PID: 2277 (nginx)
    CGroup: /system.slice/nginx.service
    ├─2277 nginx: master process /usr/sbin/nginx -g daemon on; master_...
    ├─2278 nginx: worker process
    ├─2279 nginx: worker process
    ├─2280 nginx: worker process
    └─2281 nginx: worker process


    I had just rebooted as I was doing a little more testing ...

    “Life is all an Elaborate Hoax”

  • @texxasrulez


    Try now to reboot again and say us if nginx is started automatically. After reboot, if nginx is not up, post us the log from /var/log/nginx/error.log

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • It did not start automatically and here is log entry


    [emerg] 532#0: bind() to local_ip_address:8880 failed (99: Cannot assign requested address)

    “Life is all an Elaborate Hoax”

  • Ok, the IP is not configured yet when nginx is started.


    Please, reboot and once done do: netstat -plunt
    Then, post the result.


    EDIT: @texxasrulez More info about your environment please. VM? If yes, type? How the IP is configured exactly?

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • @texxasrulez


    Updated my previous answer. Please answer the questions.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • Here are the results after rebooting and prior to starting nginx. I have masked my LAN IP with local_ip_add


    # netstat -plunt
    Active Internet connections (only servers)
    Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
    tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 535/sshd
    tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 781/cupsd
    tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 1756/master
    tcp 0 0 127.0.0.1:8889 0.0.0.0:* LISTEN 1023/apache2
    tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN 539/named
    tcp 0 0 0.0.0.0:4190 0.0.0.0:* LISTEN 590/dovecot
    tcp 0 0 0.0.0.0:993 0.0.0.0:* LISTEN 590/dovecot
    tcp 0 0 0.0.0.0:995 0.0.0.0:* LISTEN 590/dovecot
    tcp 0 0 127.0.0.1:10023 0.0.0.0:* LISTEN 739/postgrey.pid --
    tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 1314/mysqld
    tcp 0 0 0.0.0.0:587 0.0.0.0:* LISTEN 1756/master
    tcp 0 0 0.0.0.0:48043 0.0.0.0:* LISTEN 497/rpc.statd
    tcp 0 0 127.0.0.1:12525 0.0.0.0:* LISTEN 736/policyd-weight
    tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN 590/dovecot
    tcp 0 0 127.0.0.1:783 0.0.0.0:* LISTEN 766/spamassassin
    tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN 590/dovecot
    tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 483/rpcbind
    tcp 0 0 0.0.0.0:465 0.0.0.0:* LISTEN 1756/master
    tcp 0 0 127.0.0.1:9876 0.0.0.0:* LISTEN 528/imscp_daemon
    tcp 0 0 local_ip_add:53 0.0.0.0:* LISTEN 539/named
    tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 1101/vsftpd
    tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 539/named
    tcp6 0 0 local_ip_add:46934 :::* LISTEN 797/java
    tcp6 0 0 :::22 :::* LISTEN 535/sshd
    tcp6 0 0 ::1:631 :::* LISTEN 781/cupsd
    tcp6 0 0 :::443 :::* LISTEN 1023/apache2
    tcp6 0 0 :::4190 :::* LISTEN 590/dovecot
    tcp6 0 0 :::7777 :::* LISTEN 694/java
    tcp6 0 0 :::993 :::* LISTEN 590/dovecot
    tcp6 0 0 :::9090 :::* LISTEN 694/java
    tcp6 0 0 :::9091 :::* LISTEN 694/java
    tcp6 0 0 :::995 :::* LISTEN 590/dovecot
    tcp6 0 0 :::5229 :::* LISTEN 694/java
    tcp6 0 0 :::110 :::* LISTEN 590/dovecot
    tcp6 0 0 ::1:783 :::* LISTEN 766/spamassassin
    tcp6 0 0 :::143 :::* LISTEN 590/dovecot
    tcp6 0 0 :::111 :::* LISTEN 483/rpcbind
    tcp6 0 0 :::80 :::* LISTEN 1023/apache2
    tcp6 0 0 :::47408 :::* LISTEN 497/rpc.statd
    udp 0 0 0.0.0.0:45641 0.0.0.0:* 1317/dhclient
    udp 0 0 0.0.0.0:631 0.0.0.0:* 782/cups-browsed
    udp 0 0 0.0.0.0:658 0.0.0.0:* 483/rpcbind
    udp 0 0 127.0.0.1:673 0.0.0.0:* 497/rpc.statd
    udp 0 0 0.0.0.0:54195 0.0.0.0:* 497/rpc.statd
    udp 0 0 0.0.0.0:5353 0.0.0.0:* 591/avahi-daemon: r
    udp 0 0 0.0.0.0:1900 0.0.0.0:* 663/minissdpd
    udp 0 0 local_ip_add:53 0.0.0.0:* 539/named
    udp 0 0 127.0.0.1:53 0.0.0.0:* 539/named
    udp 0 0 0.0.0.0:68 0.0.0.0:* 1317/dhclient
    udp 0 0 0.0.0.0:111 0.0.0.0:* 483/rpcbind
    udp 0 0 0.0.0.0:45380 0.0.0.0:* 591/avahi-daemon: r
    udp6 0 0 :::658 :::* 483/rpcbind
    udp6 0 0 local_ip_add:54034 :::* 797/java
    udp6 0 0 :::45992 :::* 497/rpc.statd
    udp6 0 0 :::5353 :::* 591/avahi-daemon: r
    udp6 0 0 :::10002 :::* 694/java
    udp6 0 0 :::1900 :::* 797/java
    udp6 0 0 :::31397 :::* 1317/dhclient
    udp6 0 0 :::111 :::* 483/rpcbind
    udp6 0 0 :::45335 :::* 591/avahi-daemon: r



    Here is results after starting nginx


    # netstat -plunt
    Active Internet connections (only servers)
    Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
    tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 535/sshd
    tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 781/cupsd
    tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 1756/master
    tcp 0 0 127.0.0.1:8889 0.0.0.0:* LISTEN 1023/apache2
    tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN 539/named
    tcp 0 0 local_ip_add:4443 0.0.0.0:* LISTEN 2225/nginx -g daemo
    tcp 0 0 0.0.0.0:4190 0.0.0.0:* LISTEN 590/dovecot
    tcp 0 0 0.0.0.0:993 0.0.0.0:* LISTEN 590/dovecot
    tcp 0 0 0.0.0.0:995 0.0.0.0:* LISTEN 590/dovecot
    tcp 0 0 127.0.0.1:10023 0.0.0.0:* LISTEN 739/postgrey.pid --
    tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 1314/mysqld
    tcp 0 0 0.0.0.0:587 0.0.0.0:* LISTEN 1756/master
    tcp 0 0 0.0.0.0:48043 0.0.0.0:* LISTEN 497/rpc.statd
    tcp 0 0 127.0.0.1:12525 0.0.0.0:* LISTEN 736/policyd-weight
    tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN 590/dovecot
    tcp 0 0 127.0.0.1:783 0.0.0.0:* LISTEN 766/spamassassin
    tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN 590/dovecot
    tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 483/rpcbind
    tcp 0 0 local_ip_add:8880 0.0.0.0:* LISTEN 2225/nginx -g daemo
    tcp 0 0 0.0.0.0:465 0.0.0.0:* LISTEN 1756/master
    tcp 0 0 127.0.0.1:9876 0.0.0.0:* LISTEN 528/imscp_daemon
    tcp 0 0 local_ip_add:53 0.0.0.0:* LISTEN 539/named
    tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 1101/vsftpd
    tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 539/named
    tcp6 0 0 local_ip_add:46934 :::* LISTEN 797/java
    tcp6 0 0 :::22 :::* LISTEN 535/sshd
    tcp6 0 0 ::1:631 :::* LISTEN 781/cupsd
    tcp6 0 0 :::4443 :::* LISTEN 2225/nginx -g daemo
    tcp6 0 0 :::5275 :::* LISTEN 694/java
    tcp6 0 0 :::443 :::* LISTEN 1023/apache2
    tcp6 0 0 :::5276 :::* LISTEN 694/java
    tcp6 0 0 :::7070 :::* LISTEN 694/java
    tcp6 0 0 :::4190 :::* LISTEN 590/dovecot
    tcp6 0 0 :::7777 :::* LISTEN 694/java
    tcp6 0 0 :::993 :::* LISTEN 590/dovecot
    tcp6 0 0 :::9090 :::* LISTEN 694/java
    tcp6 0 0 :::9091 :::* LISTEN 694/java
    tcp6 0 0 :::995 :::* LISTEN 590/dovecot
    tcp6 0 0 :::9412 :::* LISTEN 797/java
    tcp6 0 0 127.0.0.1:5060 :::* LISTEN 694/java
    tcp6 0 0 :::5222 :::* LISTEN 694/java
    tcp6 0 0 :::5223 :::* LISTEN 694/java
    tcp6 0 0 :::4040 :::* LISTEN 797/java
    tcp6 0 0 :::4041 :::* LISTEN 797/java
    tcp6 0 0 :::5229 :::* LISTEN 694/java
    tcp6 0 0 :::5262 :::* LISTEN 694/java
    tcp6 0 0 :::110 :::* LISTEN 590/dovecot
    tcp6 0 0 :::5263 :::* LISTEN 694/java
    tcp6 0 0 ::1:783 :::* LISTEN 766/spamassassin
    tcp6 0 0 :::143 :::* LISTEN 590/dovecot
    tcp6 0 0 :::111 :::* LISTEN 483/rpcbind
    tcp6 0 0 :::8880 :::* LISTEN 2225/nginx -g daemo
    tcp6 0 0 :::80 :::* LISTEN 1023/apache2
    tcp6 0 0 :::47408 :::* LISTEN 497/rpc.statd
    tcp6 0 0 :::7443 :::* LISTEN 694/java
    tcp6 0 0 :::5269 :::* LISTEN 694/java
    tcp6 0 0 :::54709 :::* LISTEN 797/java
    udp 0 0 0.0.0.0:45641 0.0.0.0:* 1317/dhclient
    udp 0 0 0.0.0.0:631 0.0.0.0:* 782/cups-browsed
    udp 0 0 0.0.0.0:658 0.0.0.0:* 483/rpcbind
    udp 0 0 127.0.0.1:673 0.0.0.0:* 497/rpc.statd
    udp 0 0 0.0.0.0:54195 0.0.0.0:* 497/rpc.statd
    udp 0 0 0.0.0.0:5353 0.0.0.0:* 591/avahi-daemon: r
    udp 0 0 0.0.0.0:1900 0.0.0.0:* 663/minissdpd
    udp 0 0 local_ip_add:53 0.0.0.0:* 539/named
    udp 0 0 127.0.0.1:53 0.0.0.0:* 539/named
    udp 0 0 0.0.0.0:68 0.0.0.0:* 1317/dhclient
    udp 0 0 0.0.0.0:111 0.0.0.0:* 483/rpcbind
    udp 0 0 0.0.0.0:45380 0.0.0.0:* 591/avahi-daemon: r
    udp6 0 0 :::658 :::* 483/rpcbind
    udp6 0 0 :::62141 :::* 694/java
    udp6 0 0 local_ip_add:54034 :::* 797/java
    udp6 0 0 :::45992 :::* 497/rpc.statd
    udp6 0 0 127.0.0.1:5060 :::* 694/java
    udp6 0 0 :::5353 :::* 591/avahi-daemon: r
    udp6 0 0 :::10002 :::* 694/java
    udp6 0 0 :::10004 :::* 694/java
    udp6 0 0 :::1900 :::* 797/java
    udp6 0 0 :::1935 :::* 694/java
    udp6 0 0 :::31397 :::* 1317/dhclient
    udp6 0 0 :::48732 :::* 694/java
    udp6 0 0 :::111 :::* 483/rpcbind
    udp6 0 0 :::45335 :::* 591/avahi-daemon: r

    “Life is all an Elaborate Hoax”

  • @texxasrulez Read my previous answer ;) How is your IP configured? Are you using a VM? Are you using DHCP, Are you using network manager?

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206