Here is my result of service nginx status
command.
(Debian 8 64bit)
Loaded: loaded (/lib/systemd/system/nginx.service; enabled)
Active: active (running) since Fri 2015-09-18 12:20:23 CEST; 2h 29min ago
Process: 31845 ExecStop=/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid (code=exited, status=2)
Process: 29093 ExecReload=/usr/sbin/nginx -g daemon on; master_process on; -s reload (code=exited, status=0/SUCCESS)
Process: 31851 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Process: 31848 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Main PID: 31852 (nginx)
CGroup: /system.slice/nginx.service
├─31852 nginx: master process /usr/sbin/nginx -g daemon on; master_process on
├─31853 nginx: worker process
├─31854 nginx: worker process
├─31855 nginx: worker process
└─31856 nginx: worker process
I don't really understand what Process: 31845 ExecStop=/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid (code=exited, status=2)
means and why I get status code 2.
Anyway It seems that nginx is working properly.
What should I do to resolve this message?
According to the start-stop-daemon command at this page, the status script is attempting to stop (--stop) nginx gracefully (with QUIT signal), then retry and wait at most 5 seconds (in QUIT/5). If at that moment nginx is still alive (i.e. the timeout is reached), it will return status 2.
Trying to stop a service when asked for its status is a behavior that sounds strange to me. It would fit better in a service restart script.
This does not look like a problem. I would not try to get rid of this message
I am also got this exactly same. Instead of restarting the running server, try to stop and start
Now no red marks in nginx status.