Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nginx with Supervisor keep changing status b/w Running and Starting

Tags:

Here's a preview of the status running supervisorctl status every 2 seconds:

[root@docker] ~ # supervisorctl status nginx                            RUNNING    pid 2090, uptime 0:00:02 [root@docker] ~ # supervisorctl status nginx                            STARTING    [root@docker] redis-2.8.9 # supervisorctl status nginx                            RUNNING    pid 2110, uptime 0:00:01 

Is this a normal thing for nginx to respawn every few seconds ? Knowing that nginx is setup to be run in the background with this setup:

[program:nginx] command=/usr/sbin/nginx stdout_events_enabled=true stderr_events_enabled=true 
like image 719
mulkave Avatar asked Apr 22 '14 10:04

mulkave


People also ask

How to view the status of your Nginx server?

How to View Status of Your Nginx Server 1 If the service is running (active), you’ll see a green active (running) status in the third line. 2 If Nginx is not running, it will display as inactive in standard white. 3 If something went wrong and Nginx couldn’t load, you’ll see a red status failed, with some information about the failure. More ...

Is Nginx running in the background?

That means that it should be actively running in the background, even if you don’t see anything on the screen. You can display the status of the Nginx service by entering the following command in a terminal window:

How to manage an Nginx web server?

Alternately, you can use the nginx -s command to pass instructions directly to Nginx: Force close the Nginx service by using the quit instruction with the nginx -s command: This article has outlined several methods to start, stop, and restart Nginx on your server. Use these commands for the most common operations when managing an Nginx web server.

How do I restart Nginx after configuration changes?

For major configuration changes, you can force a full restart of Nginx. This force-closes the whole service and sub-processes, and restarts the whole package. Enter the following command: The reload command keeps the Nginx server running as it reloads updated configuration files.


1 Answers

Its been a long time, but it might help someone else... set daemon off in your nginx config. Supervisord requires processes not to run as daemons.

You can also set it directly for the supervisor command:

command=/usr/sbin/nginx -g "daemon off;" 
like image 116
rafaponieman Avatar answered Nov 26 '22 12:11

rafaponieman