# Nginx and upstart

**URL:** <https://www.ruby-forum.com/t/nginx-and-upstart/236759>\
**Category:** NGINX\
**Created:** [October 1, 2013, 4:36pm UTC](https://www.ruby-forum.com/t/nginx-and-upstart/236759 "2013-10-01T16:36:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![alcina](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a587f6/32.png) [@alcina](https://www.ruby-forum.com/u/alcina)\
**Post date:** [October 1, 2013, 4:36pm UTC](https://www.ruby-forum.com/t/nginx-and-upstart/236759/1 "2013-10-01T16:36:36Z")

</div>

Hi!

I have seen this question has been asked before in the list, but  
unfortunately there haven’t been any answers, so let’s see if I have  
more luck 🙂

In can successfully upgrade the nginx binary on the fly as documented  
here:

> **[CommandLine | NGINX](https://www.nginx.com/resources/wiki/start/topics/tutorials/commandline/)**
>
> This tutorial shows you how to start, stop, and control NGINX from the command line.

However, if nginx was started via Upstart and then upgraded like this,  
Upstart ends up in a confused state:  
“status nginx” will show that nginx is running, but no PID is shown.  
“stop nginx” states that the upstart job is stopped (but nginx is still  
running)  
“start nginx” states that it works, but Upstart shows no PID as it  
normally does.  
“reload nginx” says “unknown instance”

The only way to fix this is to actually manually stop and start nginx,  
but then there is some downtime. Is it possible to work around this  
problem? Should I avoid using Upstart? If yes, what are my options to  
run nginx with the on-the-fly upgrade possibility?

Cheers, Ingo =;-\>
