0

I just setup a vps at Bluehost. Centos 6. For 2 days my nginx server closes and logs this:

[ ... ]: Signal received. Gracefully shutting down... (send signal 2 more time(s) to force shutdown)

I restarted nginx many times, checked its run levels, tested with a pair of running apps... But I can not prevent nginx to keep shutting down.

So, I searched all over. At StackOverflow a passenger author recommends to install again following instructions, which I did (twice) with no better results.

Digging more found this similar question with no good answer yet.

Digging even more, I found a solution in serverfault, related with a rails app, like in my case. But I can not locate rubber-passenger_nginx.yml because I did not used rubber.

About having the latest versions of all to compile, I double checked nginx, passenger (installed with yum at server and included as gem in the app), rvm, ruby, my rails app configuration. All is ok. But nginx stops. Help please...

Thanks @drookie for the comment. I collect some info and I am trying to learn how to track down SIGINTs in linux. This is the track of the same error on latest install, first error of install. I got like 100 of the 404 for GET /whm-server-status HTTP/1.0 (why nginx asks for apache?) and then:

App 17918 stdout: 
App 18051 stdout: 
2015/09/28 23:15:01 [error] 14602#0: *179 open() "/usr/share/nginx/html/whm-server-status" failed (2: No such file or directory), client: 127.0.0.1, server: localhost, request: "GET /whm-server-status HTTP/1.0"
[ 2015-09-28 23:16:03.2224 14578/7f23d3390700 age/Cor/CoreMain.cpp:793 ]: Disconnecting long-running connections for process 18051, application /home/user/ror/app/current/public

[ 2015-09-28 23:16:55.1231 14578/7f23d28bc700 age/Cor/CoreMain.cpp:506 ]: Signal received. Gracefully shutting down... (send signal 2 more time(s) to force shutdown)
[ 2015-09-28 23:16:55.1232 14578/7f23d33d2800 age/Cor/CoreMain.cpp:875 ]: Received command to shutdown gracefully. Waiting until all clients have disconnected...
[ 2015-09-28 23:16:55.1232 14578/7f23d33d2800 age/Cor/CoreMain.cpp:793 ]: Disconnecting long-running connections for process 14734, application /home/user/ror/app/current/public
[ 2015-09-28 23:16:55.1237 14578/7f23d28bc700 Ser/Server.h:758 ]: [ServerThr.1] Freed 128 spare client objects
[ 2015-09-28 23:16:55.1238 14578/7f23d28bc700 Ser/Server.h:443 ]: [ServerThr.1] Shutdown finished
[ 2015-09-28 23:16:55.1238 14578/7f23d1e3a700 Ser/Server.h:758 ]: [ServerThr.2] Freed 128 spare client objects
[ 2015-09-28 23:16:55.1238 14578/7f23d1e3a700 Ser/Server.h:443 ]: [ServerThr.2] Shutdown finished

[ 2015-09-28 23:16:55.1241 14578/7f23d13b8700 Ser/Server.h:758 ]: [ApiServer] Freed 0 spare client objects
[ 2015-09-28 23:16:55.1241 14583/7fd4931c3700 age/Ust/UstRouterMain.cpp:396 ]: Signal received. Gracefully shutting down... (send signal 2 more time(s) to force shutdown)
[ 2015-09-28 23:16:55.1241 14578/7f23d13b8700 Ser/Server.h:443 ]: [ApiServer] Shutdown finished
[ 2015-09-28 23:16:55.1242 14583/7fd493453800 age/Ust/UstRouterMain.cpp:466 ]: Received command to shutdown gracefully. Waiting until all clients have disconnected...
[ 2015-09-28 23:16:55.1242 14578/7f23d33d2800 age/Cor/CoreMain.cpp:793 ]: Disconnecting long-running connections for process 14734, application /home/user/ror/app/current/public
[ 2015-09-28 23:16:55.1242 14583/7fd492741700 Ser/Server.h:758 ]: [UstRouterApiServer] Freed 0 spare client objects
[ 2015-09-28 23:16:55.1242 14583/7fd492741700 Ser/Server.h:443 ]: [UstRouterApiServer] Shutdown finished
[ 2015-09-28 23:16:55.1244 14583/7fd4931c3700 Ser/Server.h:443 ]: [UstRouter] Shutdown finished
[ 2015-09-28 23:16:55.1245 14583/7fd493453800 age/Ust/UstRouterMain.cpp:497 ]: Passenger UstRouter shutdown finished
[ 2015-09-28 23:16:55.3360 14578/7f23d33d2800 age/Cor/CoreMain.cpp:941 ]: Passenger core shutdown finished

ps alx | grep nginx outputs:

1     0   374     1  20   0 108560  1864 rt_sig Ss   ?          0:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
5   399   375   374  20   0 109000  3132 ep_pol S    ?          0:00 nginx: worker process                   
0   500   593 32668  20   0 103304   832 -      R+   pts/0      0:00 grep nginx

Here /etc/nginx/nginx.conf

user  nginx;
worker_processes  1;

error_log  /var/log/nginx/error.log;
#error_log  /var/log/nginx/error.log  notice;
#error_log  /var/log/nginx/error.log  info;

pid        /var/run/nginx.pid;


events {
    worker_connections  1024;
}


http {
    client_max_body_size 5M;
    include   /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  3;

    #gzip  on;
    index   index.html index.htm;

    # Load modular configuration files from the /etc/nginx/conf.d directory.
    # See http://nginx.org/en/docs/ngx_core_module.html#include
    # for more information.
    include /etc/nginx/conf.d/*.conf;

    server {
    listen       80 default_server;
        server_name  localhost;
        root         /usr/share/nginx/html;

        #charset koi8-r;

        #access_log  /var/log/nginx/host.access.log  main;

        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

        location / {
        }

        # redirect server error pages to the static page /40x.html
        #
    error_page  404              /404.html;
        location = /40x.html {
        }

    # redirect server error pages to the static page /50x.html
        #
    error_page   500 502 503 504  /50x.html;
        location = /50x.html {
        }
    }
}
8
  • 1
    Something clearly is sending your nginx a SIGINT. Passenger has nothing to do with it. You should investigate who's sending SIGINT to nginx. – drookie Sep 28 '15 at 7:38
  • Please show me ps aulx | grep nginx while it's running, may be there's something in the way it's started. – drookie Sep 29 '15 at 4:08
  • Tryed to run ps aulx | grep nginx, but gave me ERROR: Conflicting format options. I test options, alx worked. Hope it helps. – Dieglock Sep 29 '15 at 5:42
  • I'm currently out of ideas. Last one - is there any daemon directive inside your nginx configuration files ? – drookie Sep 29 '15 at 6:29
  • If the site I am running is in a subfolder and the principal domain has no site, can that explain situation? I almost have ready the site for the principal domain. When 2 of them are up and running, hope does not happen anymore... I will check also for the daemon as soon as I can. Thanks. – Dieglock Sep 30 '15 at 16:03
0

I found the problem and it was not nginx or passenger. Server had WHM installed. So, the security of the control panel was changing the orders I gave in bash. Also, install was old. Once whm was updated and used properly, the problem of nginx shutting down solved. @drookie, you were right, not a simple daemon, but whole whm was causing it. Thanks.

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.